Class PostgresEnum
Represents the metadata for a PostgreSQL enum.
Namespace: Npgsql.EntityFrameworkCore.PostgreSQL.Metadata
Assembly: Npgsql.EntityFrameworkCore.PostgreSQL.dll
Syntax
public class PostgresEnum
Properties
| Improve this Doc View SourceAnnotatable
The Annotatable that stores the enum.
Declaration
public virtual Annotatable Annotatable { get; }
Property Value
Type | Description |
---|---|
Annotatable |
Labels
The enum labels.
Declaration
public virtual IReadOnlyList<string> Labels { get; set; }
Property Value
Type | Description |
---|---|
IReadOnlyList<><string> |
Name
The enum name.
Declaration
public virtual string Name { get; }
Property Value
Type | Description |
---|---|
string |
Schema
The enum schema or null to represent the default schema.
Declaration
public virtual string? Schema { get; }
Property Value
Type | Description |
---|---|
string? |
Methods
| Improve this Doc View SourceFindPostgresEnum(IReadOnlyAnnotatable, string?, string)
Finds a PostgresEnum in the
Declaration
public static PostgresEnum? FindPostgresEnum(IReadOnlyAnnotatable annotatable, string? schema, string name)
Parameters
Type | Name | Description |
---|---|---|
IReadOnlyAnnotatable | annotatable | The annotatable to search for the enum. |
string? | schema | The enum schema or null to use the model's default schema. |
string | name | The enum name. |
Returns
Type | Description |
---|---|
PostgresEnum | The PostgresEnum from the |
GetOrAddPostgresEnum(IMutableAnnotatable, string?, string, string[])
Gets or adds a PostgresEnum from or to the
Declaration
public static PostgresEnum GetOrAddPostgresEnum(IMutableAnnotatable annotatable, string? schema, string name, string[] labels)
Parameters
Type | Name | Description |
---|---|---|
IMutableAnnotatable | annotatable | The annotatable from which to get or add the enum. |
string? | schema | The enum schema or null to use the model's default schema. |
string | name | The enum name. |
string[] | labels | The enum labels. |
Returns
Type | Description |
---|---|
PostgresEnum | The PostgresEnum from the |
GetOrAddPostgresEnum(IMutableAnnotatable, string, string[])
Gets or adds a PostgresEnum from or to the
Declaration
public static PostgresEnum GetOrAddPostgresEnum(IMutableAnnotatable annotatable, string name, string[] labels)
Parameters
Type | Name | Description |
---|---|---|
IMutableAnnotatable | annotatable | The annotatable from which to get or add the enum. |
string | name | The enum name. |
string[] | labels | The enum labels. |
Returns
Type | Description |
---|---|
PostgresEnum | The PostgresEnum from the |
GetPostgresEnums(IReadOnlyAnnotatable)
Gets the collection of PostgresEnum stored in the
Declaration
public static IEnumerable<PostgresEnum> GetPostgresEnums(IReadOnlyAnnotatable annotatable)
Parameters
Type | Name | Description |
---|---|---|
IReadOnlyAnnotatable | annotatable | The annotatable to search for PostgresEnum annotations. |
Returns
Type | Description |
---|---|
IEnumerable<><PostgresEnum> | The collection of PostgresEnum stored in the |