Exemple #1
0
        private Expression BuildMain(ExpressionResult[] expressionResults, ParameterCache paramCache, AffectableEntityInfo info,
                                     ParameterExpression parameter, ParameterExpression newParameter)
        {
            var newAffectableEntity = Expression.Property(newParameter, info.PropertyInfo);

            if (expressionResults.Length == 0)
            {
                return(newParameter);
            }

            var affectableEntity = Expression.Property(parameter, info.PropertyInfo);
            var selectParam      = paramCache.Get(expressionResults[0].FunctionName);
            var lambda           = Expression.Lambda(BuildIfThenElseSection(expressionResults, selectParam, info.ReturnLabel),
                                                     selectParam.Item1);
            var selectExpr = SelectExpression(selectParam.Item1.Type, affectableEntity, lambda);

            return(Expression.Assign(newAffectableEntity, selectExpr));
        }
 private static ExpressionResultSet ToResult(IEnumerable <ExpressionResult> results, ParameterCache parameters)
 {
     return(new ExpressionResultSet
     {
         ExpressionResults = results.ToArray(),
         Parameters = parameters
     });
 }
Exemple #3
0
 public AffectableEntityInfoContainer(AffectableEntityInfoCache cache)
 {
     EntityInfoCache = cache;
     ParameterCache  = new ParameterCache(cache);
 }