# Class PostgresEnum

Namespace
  Npgsql.EntityFrameworkCore.PostgreSQL.Metadata

Assembly
  Npgsql.EntityFrameworkCore.PostgreSQL.dll

Represents the metadata for a PostgreSQL enum.

    public class PostgresEnum

Inheritance
  object
  PostgresEnum

Inherited Members
  object.Equals(object)
  object.Equals(object, object)
  object.GetHashCode()
  object.GetType()
  object.MemberwiseClone()
  object.ReferenceEquals(object, object)
  object.ToString()

## Properties

### Annotatable

The Annotatable that stores the enum.

    public virtual Annotatable Annotatable { get; }

#### Property Value

Annotatable

### Labels

The enum labels.

    public virtual IReadOnlyList<string> Labels { get; set; }

#### Property Value

IReadOnlyList<string>

### Name

The enum name.

    public virtual string Name { get; }

#### Property Value

string

### Schema

The enum schema or null to represent the default schema.

    public virtual string? Schema { get; }

#### Property Value

string

## Methods

### FindPostgresEnum(IReadOnlyAnnotatable, string?, string)

Finds a PostgresEnum in the IAnnotatable, or returns null if not found.

    public static PostgresEnum? FindPostgresEnum(IReadOnlyAnnotatable annotatable, string? schema, string name)

#### Parameters

`annotatable` IReadOnlyAnnotatable

  The annotatable to search for the enum.

`schema` string

  The enum schema or null to use the model's default schema.

`name` string

  The enum name.

#### Returns

PostgresEnum

  The PostgresEnum from the IAnnotatable.

#### Exceptions

ArgumentException

  `schema`

ArgumentNullException

  `annotatable`

ArgumentNullException

  `name`

### GetOrAddPostgresEnum(IConventionAnnotatable, string?, string, string[])

Gets or adds a PostgresEnum from or to the IMutableAnnotatable.

    public static PostgresEnum GetOrAddPostgresEnum(IConventionAnnotatable annotatable, string? schema, string name, string[] labels)

#### Parameters

`annotatable` IConventionAnnotatable

  The annotatable from which to get or add the enum.

`schema` string

  The enum schema or null to use the model's default schema.

`name` string

  The enum name.

`labels` string[]

  The enum labels.

#### Returns

PostgresEnum

  The PostgresEnum from the IMutableAnnotatable.

#### Exceptions

ArgumentException

  `schema`

ArgumentNullException

  `annotatable`

ArgumentNullException

  `name`

ArgumentNullException

  `labels`

### GetOrAddPostgresEnum(IMutableAnnotatable, string?, string, string[])

Gets or adds a PostgresEnum from or to the IMutableAnnotatable.

    public static PostgresEnum GetOrAddPostgresEnum(IMutableAnnotatable annotatable, string? schema, string name, string[] labels)

#### Parameters

`annotatable` IMutableAnnotatable

  The annotatable from which to get or add the enum.

`schema` string

  The enum schema or null to use the model's default schema.

`name` string

  The enum name.

`labels` string[]

  The enum labels.

#### Returns

PostgresEnum

  The PostgresEnum from the IMutableAnnotatable.

#### Exceptions

ArgumentException

  `schema`

ArgumentNullException

  `annotatable`

ArgumentNullException

  `name`

ArgumentNullException

  `labels`

### GetOrAddPostgresEnum(IMutableAnnotatable, string, string[])

Gets or adds a PostgresEnum from or to the IMutableAnnotatable.

    public static PostgresEnum GetOrAddPostgresEnum(IMutableAnnotatable annotatable, string name, string[] labels)

#### Parameters

`annotatable` IMutableAnnotatable

  The annotatable from which to get or add the enum.

`name` string

  The enum name.

`labels` string[]

  The enum labels.

#### Returns

PostgresEnum

  The PostgresEnum from the IMutableAnnotatable.

#### Exceptions

ArgumentNullException

  `annotatable`

ArgumentNullException

  `name`

ArgumentNullException

  `labels`

### GetPostgresEnums(IReadOnlyAnnotatable)

Gets the collection of PostgresEnum stored in the IAnnotatable.

    public static IEnumerable<PostgresEnum> GetPostgresEnums(IReadOnlyAnnotatable annotatable)

#### Parameters

`annotatable` IReadOnlyAnnotatable

  The annotatable to search for PostgresEnum annotations.

#### Returns

IEnumerable<PostgresEnum>

  The collection of PostgresEnum stored in the IAnnotatable.

#### Exceptions

ArgumentNullException

  `annotatable`