コード例 #1
0
        public ObjectConfigure <TDestination> SelectMemberWithMethod(Expression <Func <TDestination, object> > expr, Expression <Func <object> > func)
        {
            var member = ExpressionHelper.FindProperty <PropertyInfo>(expr);

            if (!properties.ContainsKey(member.Name))
            {
                properties.Add(member.Name, BindingExpressionFactory.CreateMethodBinding(member, func));
            }
            return(this);
        }
コード例 #2
0
        public ObjectConfigure <TDestination> SelectMember(Expression <Func <TDestination, object> > expr, object constant = null)
        {
            var member = ExpressionHelper.FindProperty <PropertyInfo>(expr);

            if (!properties.ContainsKey(member.Name))
            {
                properties.Add(member.Name, BindingExpressionFactory.CreatePropertyBinding(member, constant));
            }
            return(this);
        }
コード例 #3
0
        public ObjectConfigure <TDestination> SelectMemberConvert <TCovertSource, TCovertDest>(Expression <Func <TDestination, object> > expr,
                                                                                               Expression <Func <TCovertSource, TCovertDest> > convert)
        {
            var member = ExpressionHelper.FindProperty <PropertyInfo>(expr);

            if (!properties.ContainsKey(member.Name))
            {
                properties.Add(member.Name, BindingExpressionFactory.CreateConvertBinding(member, convert));
            }
            return(this);
        }
コード例 #4
0
        public ObjectConfigure <TDestination> SelectMember <TSubDestination>(Expression <Func <TDestination, object> > expr,
                                                                             Func <ObjectConfigure <TSubDestination>, ObjectConfigure <TSubDestination> > subConfigure)
        {
            var member = ExpressionHelper.FindProperty <PropertyInfo>(expr);

            if (!properties.ContainsKey(member.Name))
            {
                properties.Add(member.Name, BindingExpressionFactory.CreateObjectBinding(member, subConfigure(new ObjectConfigure <TSubDestination>())));
            }
            return(this);
        }