private static void CreateEntityTypes(Edmx edmx, string conceptualNamespace)
        {
            var associations    = edmx.GetItems <Association>();
            var associationSets = edmx.GetItems <EntityContainer.AssociationSetLocalType>();

            // First loop through the EntityTypes and populate the EntityCollection with the Entity / Columns.
            foreach (var entity in edmx.GetItems <EntityType>())
            {
                if (entity == null)
                {
                    continue;
                }

                if (Configuration.Instance.ExcludeRegexIsMatch(entity.Name))
                {
                    Trace.WriteLine(String.Format("Skipping EntityType: '{0}', the EntityType was excluded!", entity.Name));

                    EntityStore.Instance.ExcludedEntityCollection.Add(entity.Name, new ConceptualEntity(entity, conceptualNamespace));
                    continue;
                }

                EntityStore.Instance.EntityCollection.Add(entity.Name, new ConceptualEntity(entity, associations, associationSets, conceptualNamespace));
            }
        }
        private static void CreateEntityTypes(Edmx edmx, string conceptualNamespace)
        {
            var associations = edmx.GetItems<Association>();
            var associationSets = edmx.GetItems<EntityContainer.AssociationSetLocalType>();

            // First loop through the EntityTypes and populate the EntityCollection with the Entity / Columns.
            foreach (var entity in edmx.GetItems<EntityType>()) {
                if (entity == null)
                    continue;

                if (Configuration.Instance.ExcludeRegexIsMatch(entity.Name)) {
                    Trace.WriteLine(String.Format("Skipping EntityType: '{0}', the EntityType was excluded!", entity.Name));

                    EntityStore.Instance.ExcludedEntityCollection.Add(entity.Name, new ConceptualEntity(entity, conceptualNamespace));
                    continue;
                }

                EntityStore.Instance.EntityCollection.Add(entity.Name, new ConceptualEntity(entity, associations, associationSets, conceptualNamespace));
            }
        }
Esempio n. 3
0
 public static LinqToEdmx.Model.Storage.EntityContainer GetStorageEntityContainer(this Edmx edmx)
 {
     return(edmx.GetItems <LinqToEdmx.Model.Storage.EntityContainer>().Single());
 }
Esempio n. 4
0
 public static EntityTypeMapping GetEntityTypeMapping(this Edmx edmx, string entityFullName)
 {
     return(edmx.GetItems <EntityTypeMapping>().Where(e => e.TypeName == entityFullName).Single());
 }
Esempio n. 5
0
 public static EntityType GetEntityType(this Edmx edmx, string entityName)
 {
     return(edmx.GetItems <EntityType>().Where(e => e.Name == entityName).Single());
 }
Esempio n. 6
0
 public static string GetConceptualSchemaNamespace(this Edmx edmx)
 {
     return(edmx.GetItems <ConceptualSchema>().Single().Namespace);
 }
Esempio n. 7
0
 public static LinqToEdmx.Model.Conceptual.Association GetConceptualAssociation(this Edmx edmx, string relationship)
 {
     return(edmx.GetItems <LinqToEdmx.Model.Conceptual.Association>().Where(a => a.Name == relationship).Single());
 }
Esempio n. 8
0
 public static AssociationSetMapping GetMappingAssociationSet(this Edmx edmx, string entityName, string relationship)
 {
     return(edmx.GetItems <AssociationSetMapping>().Where(a => a.StoreEntitySet == entityName && a.Name == relationship).Single());
 }