Geeks With Blogs
Vamsidhar Mamillapalli February 2013 Entries
How to Retrieve subclass objects of type <T> from List <T> using LINQ and Generics
As a developer, we play more with IList<T>. With the help of Generics and using Enumerable.OfType<TResul... we can retrieve objects of type<T> from List<T> in more elegant way. Example: Lets assume we have a List<T> where T is of type Person. Student and Employee are two classes derived from Person. List<Person> personlist = new List<Person>(); personlist.Add(new Student()); personlist.Add(new Person()); personlist.Add(new Student()); personlist.Add(new Person());Now, ......

Posted On Saturday, February 16, 2013 9:16 PM

Copyright © Vamsidhar Mamillapalli | Powered by: