simple question for real gurus.
I lost a lot of time figuring how to map collection in nhib. mapping by code and I now I have question, why my mapping work with collection of type IList
and not with List
?
Here's the code
public class Account {
private IList<Term> Terms; // When I use List it does not work
public Account()
{
Terms = new List<Terms>();
}
public virtual IList<Term> Terms // When I use List it does not work
{
get { return _Terms; }
set
{ if (_Terms == value) return;
_Terms = value;
}
}
}
AccountMap.cs (One account have many terms)
Bag(x => x.Terms,
m =>{},
x => x.OneToMany()
);