Unable to cast object of type NHibernate.Collection.Generic.PersistentGenericBag to List

Use collection interfaces instead of concrete collections, so NHibernate can inject it with its own collection implementation.

In this case, use IList<int> instead of List<int>

Leave a Comment