What you are actually doing is trying to cast an IList into a List (casting an interface into a concrete object). This seems odd to me. What happens if you try
IList<Post> myPosts = posts; I am just doing mental arithmetic here since my .NET environment is down and am unable to make more specific suggestions. On Mar 20, 5:47 am, graphicsxp <[email protected]> wrote: > Hello, > > I've got two classes, CGMPost and MSMPost, which both inherits from a > class Post. > > I have a IList called 'posts' that contains a collection of CGMPost > and MSMPost entities. > > If I do that : > > List<Post> myPosts = posts as List<Post>; > > then myPosts is null (altough posts contains 7 entities of type > CGMPost and MSMPost). > > Why is that ?
