Advertisement
TSorbera

Untitled

Dec 3rd, 2013
188
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.65 KB | None | 0 0
  1. void Main()
  2. {
  3.     var groups_to_querry = new List<Groups>();
  4.     var contacts = groups_to_querry
  5.                 .SelectMany(x => x.Contacts)
  6.                 .Where(x => x.ID == Guid.Empty)
  7.                 .SelectMany(p => p.ContactDetails)
  8.                 .Where(x => x.ID == Guid.Empty)
  9.                 .SelectMany(x => x.Contacts);
  10. }
  11.  
  12. class Groups
  13. {
  14.     public ICollection<Contact> Contacts { get; set; }
  15. }
  16. class Contact
  17. {
  18.     public Guid ID { get; set; }
  19.     public ICollection<ContactDetail> ContactDetails { get; set; }
  20. }
  21. class ContactDetail
  22. {
  23.     public Guid ID { get; set; }
  24.     public ICollection<Contact> Contacts { get; set; }
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement