1

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?

1 Answer 1

2

The naming is essential. Your field is

_lineBrandlocalizations // see the lower l localizations

while it should be

_lineBrandLocalizations // see the upper L Localizations
Sign up to request clarification or add additional context in comments.

2 Comments

Great to see that! Enjoy NHibernate, sir ;)
I do, but I'm not a sir! :)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.