Hello, I added some calculated read-only properties to my class and it's now throwing a QueryException: could not resolve property.
Here is my class (fake calculations right now):
public class IncompleteApplication : DealerBase
{
public virtual string Content { get; set; }
public virtual string LegalBusinessName
{
get
{
return "Leg";
}
}
public virtual string DbaName
{
get
{
return "Dba";
}
}
}
Mapping:
public class IncompleteApplicationMap : DealerBaseMap<IncompleteApplication>
{
public IncompleteApplicationMap()
{
Schema("Dealer");
Table("XmlSerialization");
Map(app => app.Content);
}
}
And calling code:
data.GridDataItems = (from app in _Repository.GetAll()
select new GridData.GridDataItem()
{
ID = app.Id,
SubmittedDate = app.LastUpdated,
UserName = app.User.UserName,
LegalBusinessName = app.LegalBusinessName,
DbaName = app.DbaName
}).ToArray();
_Repository.GetAll() returns an IQueryable. When I add a .ToList() after GetAll() the code runs just fine (although I get a Select N + 1 situation).
Thanks for any help!