EnumType.Create Method (String, String, PrimitiveType, Boolean, IEnumerable<EnumMember>, IEnumerable<MetadataProperty>)
Creates a read-only EnumType instance.
Assembly: EntityFramework (in EntityFramework.dll)
[SuppressMessageAttribute("Microsoft.Naming", "CA1726:UsePreferredTerms", MessageId = "Flags")] public static EnumType Create( string name, string namespaceName, PrimitiveType underlyingType, bool isFlags, IEnumerable<EnumMember> members, IEnumerable<MetadataProperty> metadataProperties )
Parameters
- name
-
Type:
System.String
The name of the enumeration type.
- namespaceName
-
Type:
System.String
The namespace of the enumeration type.
- underlyingType
-
Type:
System.Data.Entity.Core.Metadata.Edm.PrimitiveType
The underlying type of the enumeration type.
- isFlags
-
Type:
System.Boolean
Indicates whether the enumeration type can be treated as a bit field; that is, a set of flags.
- members
-
Type:
System.Collections.Generic.IEnumerable<EnumMember>
The members of the enumeration type.
- metadataProperties
-
Type:
System.Collections.Generic.IEnumerable<MetadataProperty>
Metadata properties to be associated with the enumeration type.
Return Value
Type: System.Data.Entity.Core.Metadata.Edm.EnumTypeThe newly created EnumType instance.
Exception | Condition |
---|---|
ArgumentNullException | underlyingType is null. |
ArgumentException | name is null or empty. -or- namespaceName is null or empty. -or- underlyingType is not a supported underlying type. -or- The specified members do not have unique names. -or- The value of a specified member is not in the range of the underlying type. |