I am trying to create what seems like a relatively simple predicate statement for Dapper-Extensions in C# after doing a good number of these, but in one case I need to compare two fields rather than a field and a fixed object value:
multiPred.Add<ChargingProfile>(new PredicateGroup
{
Operator = GroupOperator.And,
Predicates = new List<IPredicate>
{
Predicates.Field<ChargingProfile>(f => f.EndDt, Operator.Eq, null, true),
// the below statement should check if f.NextChargeDt is greater than f.EndDt
// (string value is obviously not correct, but to illustrate)
Predicates.Field<ChargingProfile>(f => f.NextChargeDt, Operator.Gt, "f.EndDt")
}
});
I can't (or don't know how to) access the expression in the value parameter, so there must be some other way of doing this?
Thanks for any insights you can offer.