public ExpressionValues Operation(ExpressionValues mergeWith, Func <PossibleValueSet, PossibleValueSet, PossibleValueSet> operation) { var result = new ExpressionValues(operation(Values, mergeWith.Values)); foreach (string memberExpression in MemberExpressions.Union(mergeWith.MemberExpressions)) { var left = GetValues(memberExpression); var right = mergeWith.GetValues(memberExpression); result.MemberExpressionValuesIfEmptyOuterJoined.Add(memberExpression, operation(left, right)); } return(result); }
internal static void Find(Expression expression, NameGenerator nameGenerator, IIsEntityDecider isEntityDecider, Dictionary <string, NhJoinClause> joins, Dictionary <MemberExpression, QuerySourceReferenceExpression> expressionMap) { WhereJoinDetector f = new WhereJoinDetector(nameGenerator, isEntityDecider, joins, expressionMap); f.VisitExpression(expression); ExpressionValues values = f._values.Pop(); foreach (var memberExpression in values.MemberExpressions) { // If outer join can never produce true, we can safely inner join. if (!values.GetValues(memberExpression).Contains(true)) { f.MakeInnerIfJoined(memberExpression); } } }
public ExpressionValues Operation(ExpressionValues mergeWith, Func<PossibleValueSet, PossibleValueSet, PossibleValueSet> operation) { var result = new ExpressionValues(operation(Values, mergeWith.Values)); foreach (string memberExpression in MemberExpressions.Union(mergeWith.MemberExpressions)) { var left = GetValues(memberExpression); var right = mergeWith.GetValues(memberExpression); result.MemberExpressionValuesIfEmptyOuterJoined.Add(memberExpression, operation(left, right)); } return result; }