fork download
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6. public class Test {
  7. public static void Main () {
  8. dynamic[] salaries = {new {
  9. Region = "Амурская область",
  10. KindOfActivity = "Образование",
  11. Salary = 1000
  12. }, new {
  13. Region = "не Амурская область",
  14. KindOfActivity = "Образование",
  15. Salary = 2000
  16. }, new {
  17. Region = "Амурская область",
  18. KindOfActivity = "что-то ещё",
  19. Salary = 3000
  20. }, new {
  21. Region = "Амурская область",
  22. KindOfActivity = "Образование",
  23. Salary = 1500
  24. }};
  25.  
  26. IEnumerable<int> query = salaries.Where<dynamic>( s => {
  27. return s.Region == "Амурская область" && s.KindOfActivity == "Образование";
  28. } ).Select<dynamic, int>( s => s.Salary );
  29. Console.WriteLine(string.Join("\n", query.ToArray()));
  30. }
  31. }
Success #stdin #stdout 0.43s 31264KB
stdin
Standard input is empty
stdout
1000
1500