R – How to tell NHibernate to map one-to-many relationship to List and not IList

nhibernateone-to-many

Can I somehow tell NHibernate to map my one-to-many relationship to a property which is of type List instead of the interface IList?

I know that NHibernate uses its own IList-implementation for lazy loading, but I don't need this feature. Instead I need a class that is serializable, which I cannot accomplish by using the IList interface instead of the concrete List-class.

Best Answer

The simple answer is no, you can't tell NHibernate to use List<T>. This earlier question discusses it in more detail.

The best article I could find on serializing NHibernate objects is targeted to WCF users.