This question is locked. New answers and comments are not allowed.
I want to use custom binding on a grid which displays a DTO. I'm using nHibernate to load information from the database. However, I'm getting the following error message:
The field 'Status' comes from the DTO, but is named differently in the original entity. However, filtering as in the demo doesn't work when I do this:
The original queryover is structured as follows:
How do I instruct the ExpressionBuilder to work on the DTO instead of on the original entity?
System.Exception: Could not determine member from IIF((item != null), item.Status, Onbekend)
The field 'Status' comes from the DTO, but is named differently in the original entity. However, filtering as in the demo doesn't work when I do this:
if
(command.FilterDescriptors.Any())
{
query = query.Where(ExpressionBuilder.Expression<MyDto>(command.FilterDescriptors));
}
The original queryover is structured as follows:
var query = Session.QueryOver<OriginalEntity>(() => entityAlias)
.SelectList(.....)
.TransformUsing(Transformers.AliasToBean<MyDto>());
How do I instruct the ExpressionBuilder to work on the DTO instead of on the original entity?