Пример #1
0
 private static Expression GetPopulationCallbackOrNull(
     InvocationPosition position,
     IMemberPopulator memberPopulator,
     IObjectMappingData mappingData)
 {
     return(memberPopulator.MapperData.GetMappingCallbackOrNull(position, mappingData.MapperData));
 }
Пример #2
0
 public Expression GetCallbackOrNull(
     InvocationPosition position,
     IQualifiedMemberContext context,
     IMemberMapperData mapperData)
 {
     return(_mappingCallbackFactories?.FirstOrDefault(f => f.AppliesTo(position, context))?.Create(mapperData));
 }
Пример #3
0
 public CallbackSpecifier(MapperContext mapperContext, InvocationPosition invocationPosition)
     : this(
         MappingConfigInfo
         .AllRuleSetsAndSourceTypes(mapperContext)
         .ForTargetType <TTarget>()
         .WithInvocationPosition(invocationPosition),
         QualifiedMember.None)
 {
 }
 public static Expression GetMappingCallbackOrNull(
     this IQualifiedMemberContext context,
     InvocationPosition invocationPosition,
     IMemberMapperData mapperData)
 {
     return(mapperData
            .MapperContext
            .UserConfigurations
            .GetCallbackOrNull(invocationPosition, context, mapperData));
 }
Пример #5
0
 public virtual bool AppliesTo(InvocationPosition invocationPosition, IQualifiedMemberContext context)
 => (InvocationPosition == invocationPosition) && base.AppliesTo(context);
Пример #6
0
 public override bool AppliesTo(InvocationPosition invocationPosition, IQualifiedMemberContext context)
 => context.TargetMember.Type.IsAssignableTo(_creationTargetType) && base.AppliesTo(invocationPosition, context);
Пример #7
0
 private static Expression GetCreationCallbackOrNull(InvocationPosition invocationPosition, IMemberMapperData mapperData)
 => mapperData.MapperContext.UserConfigurations.GetCreationCallbackOrNull(invocationPosition, mapperData);
Пример #8
0
 public InstanceCreationCallbackSpecifier(MappingConfigInfo configInfo, InvocationPosition invocationPosition)
 {
     _configInfo = configInfo.WithInvocationPosition(invocationPosition);
 }
Пример #9
0
 public InstanceCreationCallbackSpecifier(MapperContext mapperContext, InvocationPosition invocationPosition)
     : this(MappingConfigInfo.AllRuleSetsAndSourceTypes(mapperContext).ForTargetType <TTarget>(), invocationPosition)
 {
 }
Пример #10
0
 public Expression GetCreationCallbackOrNull(InvocationPosition position, IMemberMapperData mapperData)
 => _creationCallbackFactories?.FirstOrDefault(f => f.AppliesTo(position, mapperData))?.Create(mapperData);
Пример #11
0
 public MappingConfigInfo WithInvocationPosition(InvocationPosition position)
 {
     InvocationPosition = position;
     return(this);
 }