Suppose we have a base entity class called BaseEntity.
We create a child Entity named Status inheriting BaseEntity
public class Status: BaseEntity
Now lets assume we have two Generic List
List<BaseEntity> mainList = new List<BaseEntity>();
List<Status> childList;
Now we want to convert mainList to childList and this can be converted easily by using Cast extension method that can be found under System.Linq
childList = mainList.Cast<Status>().ToList();
Happy Conversion!!!
I am truly versatile and 360 degree Engineer having wide range of development experience in .NET and Java Platform. I am also proficient in system level programming in C++. To me technology is not at all a problem, it’s the client requirement that matters! That is I am ready and comfortable to use any technology to make the business of my client a success.
In my five years of experience I have the opportunities to work for fortune 500 companies of US and many renowned clients from Europe.
My Linkedin Profile: http://bd.linkedin.com/in/mahmudazad