EntityContainer.Create Method (String, DataSpace, IEnumerable<EntitySetBase>, IEnumerable<EdmFunction>, IEnumerable<MetadataProperty>)
The factory method for constructing the EntityContainer object.
Assembly: EntityFramework (in EntityFramework.dll)
public static EntityContainer Create( string name, DataSpace dataSpace, IEnumerable<EntitySetBase> entitySets, IEnumerable<EdmFunction> functionImports, IEnumerable<MetadataProperty> metadataProperties )
Parameters
- name
-
Type:
System.String
The name of the entity container to be created.
- dataSpace
-
Type:
System.Data.Entity.Core.Metadata.Edm.DataSpace
DataSpace in which this entity container belongs to.
- entitySets
-
Type:
System.Collections.Generic.IEnumerable<EntitySetBase>
Entity sets that will be included in the new container. Can be null.
- functionImports
-
Type:
System.Collections.Generic.IEnumerable<EdmFunction>
Functions that will be included in the new container. Can be null.
- metadataProperties
-
Type:
System.Collections.Generic.IEnumerable<MetadataProperty>
Metadata properties to be associated with the instance.
Exception | Condition |
---|---|
ArgumentException | Thrown if the name argument is null or empty string. |
The newly created EntityContainer will be read only.