コード例 #1
0
        public LambdaInfo Create(MappingSchema mappingSchema, Type from, Type to)
        {
            var ex  = ConvertBuilder.GetConverter(mappingSchema, from, to);
            var lm  = ex.Item1.Compile();
            var ret = new LambdaInfo(ex.Item1, ex.Item2, lm, ex.Item3);

            Set(_expressions, from, to, ret);

            return(ret);
        }
コード例 #2
0
        private static void Init()
        {
            var expr = ConvertBuilder.GetConverter(null, typeof(TFrom), typeof(TTo));

            _expression = (Expression <Func <TFrom, TTo> >)expr.Item1;

            var rexpr =
                (Expression <Func <TFrom, TTo> >)expr.Item1.Transform(e => e is DefaultValueExpression ? e.Reduce() : e);

            From = rexpr.Compile();
        }
コード例 #3
0
 public static Type GetDefaultMappingFromEnumType(MappingSchema mappingSchema, Type enumType)
 {
     return(ConvertBuilder.GetDefaultMappingFromEnumType(mappingSchema, enumType));
 }