private IEnumerable<IEntityMappingProvider> GetParentMappings(IEntityMappingProvider childMapping)
 {
     return from m in _originalMappings
            where m.EntityType != childMapping.EntityType
            where IsDerivedFrom(childMapping.EntityType, m.EntityType)
            select m;
 }
        public IEntityMapping BuildMapping(IEntityMappingProvider mapping)
        {
            _currentType = mapping.EntityType;
            var classes = mapping.Classes.Select(BuildMapping);
            var properties = mapping.Properties.Select(BuildMapping);

            return new EntityMapping(mapping.EntityType, classes, properties);
        }
 public void Visit(IEntityMappingProvider entityMappingProvider)
 {
     _currentEntityType = entityMappingProvider.EntityType;
 }
Ejemplo n.º 4
0
 public void Visit(IEntityMappingProvider entityMappingProvider)
 {
     _currentEntityMapping    = entityMappingProvider;
     PropertyMappingProviders = new List <IPropertyMappingProvider>();
     ClassMappingProviders    = new List <IClassMappingProvider>();
 }
 public void Visit(IEntityMappingProvider entityMappingProvider)
 {
 }
 public InheritanceTreeProvider(IEntityMappingProvider mainProvider, IEnumerable <IEntityMappingProvider> parentProviders)
 {
     _mainProvider    = mainProvider;
     _parentProviders = parentProviders.ToDictionary(mp => mp.EntityType, mp => mp);
     DiscoverProperties();
 }
Ejemplo n.º 7
0
 public ClosedGenericEntityMappingProvider(IEntityMappingProvider openGenericProvider, params Type[] typeArguments)
 {
     _closedGenericEntityType = openGenericProvider.EntityType.MakeGenericType(typeArguments);
     _collector = new OpenGenericEntityMappingCollector(typeArguments);
     openGenericProvider.Accept(_collector);
 }
 public void Visit(IEntityMappingProvider entityMappingProvider)
 {
 }
 /// <summary>Validates the specified entity mapping provider.</summary>
 public void Visit(IEntityMappingProvider entityMappingProvider)
 {
     _currentType = entityMappingProvider.EntityType;
 }
 public InheritanceTreeProvider(IEntityMappingProvider mainProvider, IEnumerable<IEntityMappingProvider> parentProviders)
 {
     _mainProvider = mainProvider;
     _parentProviders = parentProviders.ToDictionary(mp => mp.EntityType, mp => mp);
 }
 internal ClosedGenericEntityMappingProvider(Type closedGenericType, IEntityMappingProvider openGenericEntityMappingProvider)
     : base(closedGenericType, openGenericEntityMappingProvider)
 {
 }
Ejemplo n.º 12
0
 internal EntityMappingProvider(Type entityType, IEntityMappingProvider parentEntityMappingProvider)
 {
     EntityType = entityType;
     _parentEntityMappingProvider = parentEntityMappingProvider;
 }
 public ClosedGenericEntityMappingProvider(IEntityMappingProvider openGenericProvider, params Type[] typeArguments)
 {
     _closedGenericEntityType = openGenericProvider.EntityType.MakeGenericType(typeArguments);
     _collector = new OpenGenericEntityMappingCollector(typeArguments);
     openGenericProvider.Accept(_collector);
 }
 public void Visit(IEntityMappingProvider entityMappingProvider)
 {
     _currentEntityMapping = entityMappingProvider;
     PropertyMappingProviders = new List<IPropertyMappingProvider>();
     ClassMappingProviders = new List<IClassMappingProvider>();
 }