ASP.NET Nhibernate 错误
ASP.NET error with Nhibernate
我有 LineBrand table,它有很多 LineBrandLocalization。
当我把它映射成
HasMany(x => x.LineBrandLocalizations)
.KeyColumn("line_brand_id")
.Access.CamelCaseField(Prefix.Underscore)
.Cascade.AllDeleteOrphan()
.Fetch.Subselect()
.Inverse();
并且 LineBrandLocalizations 是
public virtual IEnumerable<LineBrandLocalization> LineBrandLocalizations
{
get { return _lineBrandlocalizations; }
}
private IList<LineBrandLocalization> _lineBrandlocalizations = new List<LineBrandLocalization>();
我收到错误
NHibernate.PropertyNotFoundException: Could not find field '_lineBrandLocalizations' in class 'LineBrand'.
有什么问题吗?
命名是必不可少的。你的领域是
_lineBrandlocalizations // see the lower l localizations
应该是
_lineBrandLocalizations // see the upper L Localizations
我有 LineBrand table,它有很多 LineBrandLocalization。 当我把它映射成
HasMany(x => x.LineBrandLocalizations)
.KeyColumn("line_brand_id")
.Access.CamelCaseField(Prefix.Underscore)
.Cascade.AllDeleteOrphan()
.Fetch.Subselect()
.Inverse();
并且 LineBrandLocalizations 是
public virtual IEnumerable<LineBrandLocalization> LineBrandLocalizations
{
get { return _lineBrandlocalizations; }
}
private IList<LineBrandLocalization> _lineBrandlocalizations = new List<LineBrandLocalization>();
我收到错误
NHibernate.PropertyNotFoundException: Could not find field '_lineBrandLocalizations' in class 'LineBrand'.
有什么问题吗?
命名是必不可少的。你的领域是
_lineBrandlocalizations // see the lower l localizations
应该是
_lineBrandLocalizations // see the upper L Localizations