I have the following Company with the attribute below (excluding Id):
public virtual Category Category { get; set; }
That is mapped in a CompanyMap like this:
HasOne(x => x.Category)
.Cascade.All();
The Category has only the attribute:
public virtual string Name { get; set; }
The CategoryMap:
Map(x => x.Name)
.Column("Name")
.Length(40)
.Unique();
The table is successfully created in the DB.
I have a repository with the following queryover:
var test = Session.QueryOver<Company>()
.WhereRestrictionOn(dbCompany => dbCompany.Category.Name)
.IsLike(category.Name);
category.name is just any string.
Then I want to access the DB and get the results with:
var result = test.List();
I get the following exception:
could not resolve property: Category.Name of: My.Name.Space.Company
What is wrong with the query over?