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)); } }
public static LinqToEdmx.Model.Storage.EntityContainer GetStorageEntityContainer(this Edmx edmx) { return(edmx.GetItems <LinqToEdmx.Model.Storage.EntityContainer>().Single()); }
public static EntityTypeMapping GetEntityTypeMapping(this Edmx edmx, string entityFullName) { return(edmx.GetItems <EntityTypeMapping>().Where(e => e.TypeName == entityFullName).Single()); }
public static EntityType GetEntityType(this Edmx edmx, string entityName) { return(edmx.GetItems <EntityType>().Where(e => e.Name == entityName).Single()); }
public static string GetConceptualSchemaNamespace(this Edmx edmx) { return(edmx.GetItems <ConceptualSchema>().Single().Namespace); }
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()); }
public static AssociationSetMapping GetMappingAssociationSet(this Edmx edmx, string entityName, string relationship) { return(edmx.GetItems <AssociationSetMapping>().Where(a => a.StoreEntitySet == entityName && a.Name == relationship).Single()); }