Ejemplo n.º 1
0
        private static MappingContextInfo GetAppropriateMappingContext(SwapArgs swapArgs)
        {
            if (swapArgs.ContextTypesMatch())
            {
                return(new MappingContextInfo(swapArgs));
            }

            var dataAccess = swapArgs.GetAppropriateMappingContextAccess();

            return(new MappingContextInfo(swapArgs, dataAccess));
        }
Ejemplo n.º 2
0
        private static MappingContextInfo GetAppropriateMappingContext(SwapArgs swapArgs)
        {
            if (swapArgs.ContextTypes.All(t => t.IsSimple()))
            {
                return(GetSimpleTypesMappingContextInfo(swapArgs));
            }

            if (swapArgs.ContextTypesMatch())
            {
                return(new MappingContextInfo(swapArgs));
            }

            var contextAccess = swapArgs.GetAppropriateMappingContextAccess();

            return(new MappingContextInfo(swapArgs, contextAccess));
        }