Share via


EnumType.Create Method

Definition

Creates a read-only EnumType instance.

[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1726:UsePreferredTerms", MessageId="Flags")]
public static System.Data.Entity.Core.Metadata.Edm.EnumType Create (string name, string namespaceName, System.Data.Entity.Core.Metadata.Edm.PrimitiveType underlyingType, bool isFlags, System.Collections.Generic.IEnumerable<System.Data.Entity.Core.Metadata.Edm.EnumMember> members, System.Collections.Generic.IEnumerable<System.Data.Entity.Core.Metadata.Edm.MetadataProperty> metadataProperties);
static member Create : string * string * System.Data.Entity.Core.Metadata.Edm.PrimitiveType * bool * seq<System.Data.Entity.Core.Metadata.Edm.EnumMember> * seq<System.Data.Entity.Core.Metadata.Edm.MetadataProperty> -> System.Data.Entity.Core.Metadata.Edm.EnumType
Public Shared Function Create (name As String, namespaceName As String, underlyingType As PrimitiveType, isFlags As Boolean, members As IEnumerable(Of EnumMember), metadataProperties As IEnumerable(Of MetadataProperty)) As EnumType

Parameters

name
String

The name of the enumeration type.

namespaceName
String

The namespace of the enumeration type.

underlyingType
PrimitiveType

The underlying type of the enumeration type.

isFlags
Boolean

Indicates whether the enumeration type can be treated as a bit field; that is, a set of flags.

members
IEnumerable<EnumMember>

The members of the enumeration type.

metadataProperties
IEnumerable<MetadataProperty>

Metadata properties to be associated with the enumeration type.

Returns

The newly created EnumType instance.

Attributes

Exceptions

underlyingType is null.

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.

Applies to