Ejemplo n.º 1
0
        private static IMapper DefaultMapper(Type inputType, Type outputType)
        {
            var defaultMappings = MapCache.DefaultMappings(inputType);

            if (!defaultMappings.TryGetValue(outputType, out IMapper mapper))
            {
                var configuration = MapCache.Configuration(inputType, outputType);
                mapper = configuration.CreateMapper();

                mapper = defaultMappings.GetOrAdd(outputType, mapper);
            }

            return(mapper);
        }
Ejemplo n.º 2
0
 private static ConcurrentDictionary <Type, IMapper> DefaultMappings <I>(I input)
 {
     return(MapCache.DefaultMappings(typeof(I)));
 }