I want to map a property only if a specific column is eual to one of two values,
currently I have tried this:
HasMany<Event>(u => u.Events)
.KeyColumn("Id")
.Cascade.AllDeleteOrphan()
.OrderBy("OrderByDate desc")
.Where(e => e.Status == Status.New || e.Status == Status.Old);
but I get an exception “Unable to convert expression to SQL”
how can I create a mapping with two where clauses with an OR operator between them ?
EDIT: I don’t want to use SQL in my mapping, I want to use lambda expression (if possible…)
the implementation does handle some things but it is far from complete (especially
ExpressionType.OrElse/BinaryExpressionis not handled). You have to write sql yourself or enhance the implementation of classExpressionToSql.