fork download
  1. using System;
  2. using System.Linq;
  3.  
  4. public class Test
  5. {
  6. class Employee {
  7. public string EmployeeID;
  8. public string EmployeeName;
  9. public string Division;
  10. public string DepartmentCode;
  11. public string DesignationGrpCode;
  12. }
  13.  
  14. class context {
  15. public static Employee[] EMPLOYEE = new Employee[0];
  16. }
  17.  
  18. public static void Main()
  19. {
  20. var temp = from e in context.EMPLOYEE
  21. where (from f in context.EMPLOYEE
  22. where f.EmployeeID == "S-1287"
  23. && e.EmployeeID == f.EmployeeID
  24. select f).Any()
  25. select e;
  26.  
  27. var result = from t in temp
  28. where (from u in temp
  29. where u.DesignationGrpCode == (t.Division == "CHR" ? "CorpDMGR" : "MGT")
  30. && t.EmployeeID == u.EmployeeID
  31. select u).Any()
  32. select t;
  33. }
  34. }
  35.  
Success #stdin #stdout 0.01s 33592KB
stdin
Standard input is empty
stdout
Standard output is empty