c# select to new list based on type code example
Example: linq get objects of specific type in list
// LINQ selection by type of an object
Class Base{}
Class A : Base {}
Class B : Base {}
List<Base> collection = new List<Base>();
collection.Add(new A());
collection.Add(new B());
collection.Add(new A());
collection.Add(new A());
collection.Add(new B());
var ofTypeA = collection.OfType<A>();