public TypeMap ResolveTypeMap(TypePair typePair, ITypeMapConfiguration inlineConfiguration)
        {
            var typeMap = _typeMapPlanCache.GetOrAdd(typePair);

            // if it's a dynamically created type map, we need to seal it outside GetTypeMap to handle recursion
            if (typeMap != null && typeMap.MapExpression == null && _typeMapRegistry.GetOrDefault(typePair) == null)
            {
                lock (typeMap)
                {
                    inlineConfiguration.Configure(typeMap);
                    typeMap.Seal(this);
                    if (typeMap.IsClosedGeneric)
                    {
                        AssertConfigurationIsValid(typeMap);
                    }
                }
            }
            return(typeMap);
        }
Beispiel #2
0
 public TypeDetails CreateTypeDetails(Type type)
 {
     return(_typeDetails.GetOrAdd(type));
 }
 public Delegate GetMapperFunc(MapRequest mapRequest) => _mapPlanCache.GetOrAdd(mapRequest).Typed;
Beispiel #4
0
 public TypeDetails CreateTypeDetails(Type type) => _typeDetails.GetOrAdd(type);
 private Delegate GetExecutionPlan(MapRequest mapRequest) => _mapPlanCache.GetOrAdd(mapRequest);
 private Delegate GetExecutionPlan(MapRequest mapRequest) => _executionPlans.GetOrAdd(mapRequest);
Beispiel #7
0
 TypeDetails IProfileConfiguration.CreateTypeDetails(Type type)
 {
     return(_typeDetails.GetOrAdd(type));
 }