public IMappingExpression IncludeMembers(params string[] memberNames) { IncludedMembersNames = memberNames; memberNames.Select(name => SourceType.GetFieldOrProperty(name)).LastOrDefault(); TypeMapActions.Add(tm => tm.IncludedMembersNames = memberNames); return(this); }
public void ForAllMembers(Action <IMemberConfigurationExpression> memberOptions) { TypeMapActions.Add(typeMap => { foreach (var accessor in typeMap.DestinationTypeDetails.PublicReadAccessors) { ForMember(accessor, memberOptions); } }); }
public IMappingExpression IncludeMembers(params string[] memberNames) { IncludedMembersNames = memberNames; foreach (var memberName in memberNames) { SourceType.GetFieldOrProperty(memberName); ForSourceMemberCore(memberName, o => o.DoNotValidate()); } TypeMapActions.Add(tm => tm.IncludedMembersNames = memberNames); return(this); }
public IMappingExpression ConstructProjectionUsing(LambdaExpression ctor) { TypeMapActions.Add(tm => tm.ConstructExpression = ctor); return(this); }
public void ConvertUsing(Type typeConverterType) => TypeMapActions.Add(tm => tm.TypeConverterType = typeConverterType);
protected void IncludeBaseCore(Type sourceBase, Type destinationBase) { CheckIsDerived(Types.SourceType, sourceBase); CheckIsDerived(Types.DestinationType, destinationBase); TypeMapActions.Add(tm => tm.IncludeBaseTypes(sourceBase, destinationBase)); }
protected MappingExpressionBase(MemberList memberList, TypePair types) { Types = types; IsOpenGeneric = types.SourceType.IsGenericTypeDefinition || types.DestinationType.IsGenericTypeDefinition; TypeMapActions.Add(tm => tm.ConfiguredMemberList = memberList); }
protected void IncludeCore(Type otherSourceType, Type otherDestinationType) { CheckIsDerived(otherSourceType, Types.SourceType); CheckIsDerived(otherDestinationType, Types.DestinationType); TypeMapActions.Add(tm => tm.IncludeDerivedTypes(otherSourceType, otherDestinationType)); }
public void As(Type typeOverride) => TypeMapActions.Add(tm => tm.DestinationTypeOverride = typeOverride);