I trying to find a code of primitive type inside a List of objects and get the results into a new list.
I've been looking for something like that in Google but everyone talks about intersection between Lists and I want something like this.
int AssocCode = 2;
//Entity.ID
//Entity.Name
//Entity.AssociationCode
List<Entity> list = new List<Entity>();
list.Add(new Entity(1, "A", 1));
list.Add(new Entity(2, "B", 2));
list.Add(new Entity(3, "C", 3));
list.Add(new Entity(4, "D", 2));
list.Add(new Entity(5, "E", 2));
/*I want the results for finding that code inside the collection**/
List<Entity> newList = list .... find/intersect/select/remove/whatever (x => x.AssociationCode = AssocCode);