Aygül Salahlı
Aygül Salahlı

Reputation: 83

ASP.NET error with Nhibernate

I have LineBrand table which has many LineBrandLocalization. When I map it like

 HasMany(x => x.LineBrandLocalizations)
.KeyColumn("line_brand_id")
.Access.CamelCaseField(Prefix.Underscore)
.Cascade.AllDeleteOrphan()
.Fetch.Subselect()
.Inverse();

and LineBrandLocalizations is

public virtual IEnumerable<LineBrandLocalization> LineBrandLocalizations
{
    get { return _lineBrandlocalizations; }
}


private IList<LineBrandLocalization> _lineBrandlocalizations = new List<LineBrandLocalization>();

I get the error

NHibernate.PropertyNotFoundException: Could not find field '_lineBrandLocalizations' in class 'LineBrand'.

What is wrong with it?

Upvotes: 1

Views: 33

Answers (1)

Radim K&#246;hler
Radim K&#246;hler

Reputation: 123861

The naming is essential. Your field is

_lineBrandlocalizations // see the lower l localizations

while it should be

_lineBrandLocalizations // see the upper L Localizations

Upvotes: 2

Related Questions