I have a need for specialize collection of custom typ开发者_Python百科es in my Domain Model.
public class Foos : List<Foo>
{
}
Is there a way to map this object in NHibernate and how could I use FluentNHibernate to do this as well ?
NHibernates requires all collections to be mapped as ISomething
to facilitate lazy loading. Therefore,
private IList<Foo> foos;
// This is a property that has to be mapped
protected IList<Foo> _Foos
{
get { return foos; }
set { foos = value; }
}
public Foos Foos
{
get { return new Foos(_Foos); }
}
Don't know though how to map this with Fluent NHibernate.
精彩评论