internal static void Accept(this ITermMappingProvider termMappingProvider, IEnumerable <IMappingProviderVisitor> visitors)
 {
     foreach (var visitor in visitors)
     {
         termMappingProvider.Accept(visitor);
     }
 }
예제 #2
0
        public void BuildMapping(IDictionary <Type, IEntityMapping> mappings, Type closedGenericType, IEnumerable <ITermMappingProvider> openGenericEntityMappingProviders)
        {
            IEntityMapping entityMapping;

            if (mappings.TryGetValue(closedGenericType, out entityMapping))
            {
                return;
            }

            foreach (var openGenericMappingProvider in openGenericEntityMappingProviders)
            {
                ITermMappingProvider mappingProvider = openGenericMappingProvider.TryCloseGenericTermMappingProvider(closedGenericType);
                if (mappingProvider is ClosedGenericTermMappingProvider)
                {
                    mappingProvider.Accept(_mappingProviderVisitors);
                }

                var existingEntityMapping = BuildEntityMapping(mappings, mappingProvider);
                BuildPropertyMapping(existingEntityMapping, mappingProvider as IPropertyMappingProvider);
            }
        }