예제 #1
0
 public static object Evaluate <T>(this Session session, Expression <Func <T, object> > field,
                                   Aggregate aggregate, Func <Expression <Func <T, bool> > > filter = null)
 {
     filter ??= () => arg => true;
     return(session.Evaluate(typeof(T), CriteriaOperator.Parse($"{aggregate}({field.MemberExpressionName()})"), CriteriaOperator.FromLambda(filter())));
 }
예제 #2
0
 private static string GetRoleCriteria(string roleName)
 => CriteriaOperator.FromLambda <IPermissionPolicyRole>(role => role.Name == roleName).ToString();