Exemple #1
0
        private static Expression Create(Type sourceType, Type resultType)
        {
            var config  = new MapperExpressionConfig(guardNull: false);
            var builder = new MapperExpressionBuilder(config);

            return(builder.CreateExpression(sourceType, resultType));
        }
Exemple #2
0
        private static Delegate Create(Type sourceType, Type resultType)
        {
            var config     = new MapperExpressionConfig(guardNull: true);
            var builder    = new MapperExpressionBuilder(config);
            var expression = builder.CreateExpression(sourceType, resultType);

            var lambda = (LambdaExpression)expression;

            return(lambda.Compile());
        }