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); }
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); }
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); }
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); }