Example #1
0
 private static Expression SwapForSourceTargetAndIndex(SwapArgs swapArgs) =>
 ReplaceParameters(swapArgs, c => c.SourceAccess, c => c.TargetAccess, c => c.Index);
Example #2
0
 private static Expression SwapForSourceTargetAndCreatedObject(SwapArgs swapArgs) =>
 ReplaceParameters(swapArgs, c => c.SourceAccess, c => c.TargetAccess, c => c.CreatedObject);
Example #3
0
 private static Expression SwapForSource(SwapArgs swapArgs) =>
 ReplaceParameters(swapArgs, c => c.SourceAccess);
 private static Expression SwapNothing(SwapArgs swapArgs) => swapArgs.Lambda.Body;
 public MappingContextInfo(SwapArgs swapArgs, Type[] contextTypes)
     : this(swapArgs, swapArgs.MapperData.MappingDataObject, contextTypes)
 {
 }
        private static MappingContextInfo GetAppropriateMappingContext(Type[] contextTypes, SwapArgs swapArgs)
        {
            if (swapArgs.MapperData.TypesMatch(contextTypes))
            {
                return(new MappingContextInfo(swapArgs, contextTypes));
            }

            var dataAccess = swapArgs.MapperData.GetAppropriateMappingContextAccess(contextTypes);

            return(new MappingContextInfo(swapArgs, dataAccess, contextTypes));
        }
 public MappingContextInfo(SwapArgs swapArgs)
     : this(swapArgs, swapArgs.MapperData.MappingDataObject)
 {
 }