Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- IEnumerable<Entity> matchingEntities = entities.Where(e => e.Names.Any(n => myEntity.Names.Any(entityName => entityName.CompareNameObjects(n))));
- public class Entity
- {
- public string EntityIdentifier { get; set; }
- public List<Name> Names { get; set; }
- }
- public class Name
- {
- public string FullName { get; set; }
- public string NameType { get; set; }
- public bool CompareNameObjects(Name name2)
- {
- return FullName == name2.FullName &&
- NameType == name2.NameType;
- }
- }
Add Comment
Please, Sign In to add comment