Class PostgresEnum
- Namespace
- Npgsql.EntityFrameworkCore.PostgreSQL.Metadata
- Assembly
- Npgsql.EntityFrameworkCore.PostgreSQL.dll
Represents the metadata for a PostgreSQL enum.
public class PostgresEnum
- Inheritance
-
PostgresEnum
- Inherited Members
Properties
Annotatable
The Annotatable that stores the enum.
public virtual Annotatable Annotatable { get; }
Property Value
Labels
The enum labels.
public virtual IReadOnlyList<string> Labels { get; set; }
Property Value
Name
The enum name.
public virtual string Name { get; }
Property Value
Schema
The enum schema or null to represent the default schema.
public virtual string? Schema { get; }
Property Value
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
IReadOnlyAnnotatableThe annotatable to search for the enum.
schema
stringThe enum schema or null to use the model's default schema.
name
stringThe 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
IConventionAnnotatableThe annotatable from which to get or add the enum.
schema
stringThe enum schema or null to use the model's default schema.
name
stringThe 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
IMutableAnnotatableThe annotatable from which to get or add the enum.
schema
stringThe enum schema or null to use the model's default schema.
name
stringThe 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
IMutableAnnotatableThe annotatable from which to get or add the enum.
name
stringThe 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
IReadOnlyAnnotatableThe annotatable to search for PostgresEnum annotations.
Returns
- IEnumerable<PostgresEnum>
The collection of PostgresEnum stored in the IAnnotatable.
Exceptions
- ArgumentNullException
annotatable