Class PostgresExtension
- Namespace
- Npgsql.EntityFrameworkCore.PostgreSQL.Metadata
- Assembly
- Npgsql.EntityFrameworkCore.PostgreSQL.dll
Represents the metadata for a PostgreSQL extension.
public class PostgresExtension
- Inheritance
-
PostgresExtension
- Inherited Members
Properties
Annotatable
The Annotatable that stores the extension.
public virtual Annotatable Annotatable { get; }
Property Value
Name
The extension name.
public virtual string Name { get; }
Property Value
Schema
The extension schema or null to represent the default schema.
public virtual string? Schema { get; }
Property Value
Version
The extension version.
public virtual string? Version { get; set; }
Property Value
Methods
FindPostgresExtension(IReadOnlyAnnotatable, string?, string)
Finds a PostgresExtension in the IAnnotatable, or returns null if not found.
public static PostgresExtension? FindPostgresExtension(IReadOnlyAnnotatable annotatable, string? schema, string name)
Parameters
annotatableIReadOnlyAnnotatableThe annotatable to search for the extension.
schemastringThe extension schema. The default schema is never used.
namestringThe extension name.
Returns
- PostgresExtension
The PostgresExtension from the IAnnotatable.
Exceptions
- ArgumentException
schema- ArgumentNullException
annotatable- ArgumentNullException
name
GetOrAddPostgresExtension(IConventionAnnotatable, string?, string, string?)
Gets or adds a PostgresExtension from or to the IMutableAnnotatable.
public static PostgresExtension GetOrAddPostgresExtension(IConventionAnnotatable annotatable, string? schema, string name, string? version)
Parameters
annotatableIConventionAnnotatableThe annotatable from which to get or add the extension.
schemastringThe extension schema or null to use the model's default schema.
namestringThe extension name.
versionstringThe extension version.
Returns
- PostgresExtension
The PostgresExtension from the IMutableAnnotatable.
Exceptions
- ArgumentException
schema- ArgumentNullException
annotatable- ArgumentNullException
name
GetOrAddPostgresExtension(IMutableAnnotatable, string, string?)
Gets or adds a PostgresExtension from or to the IMutableAnnotatable.
public static PostgresExtension GetOrAddPostgresExtension(IMutableAnnotatable annotatable, string name, string? version)
Parameters
annotatableIMutableAnnotatableThe annotatable from which to get or add the extension.
namestringThe extension name.
versionstringThe extension version.
Returns
- PostgresExtension
The PostgresExtension from the IMutableAnnotatable.
Exceptions
- ArgumentNullException
annotatable- ArgumentNullException
name
GetOrAddPostgresExtension(IMutableAnnotatable, string?, string, string?)
Gets or adds a PostgresExtension from or to the IMutableAnnotatable.
public static PostgresExtension GetOrAddPostgresExtension(IMutableAnnotatable annotatable, string? schema, string name, string? version)
Parameters
annotatableIMutableAnnotatableThe annotatable from which to get or add the extension.
schemastringThe extension schema or null to use the model's default schema.
namestringThe extension name.
versionstringThe extension version.
Returns
- PostgresExtension
The PostgresExtension from the IMutableAnnotatable.
Exceptions
- ArgumentException
schema- ArgumentNullException
annotatable- ArgumentNullException
name
GetPostgresExtensions(IReadOnlyAnnotatable)
Gets the collection of PostgresExtension stored in the IAnnotatable.
public static IEnumerable<PostgresExtension> GetPostgresExtensions(IReadOnlyAnnotatable annotatable)
Parameters
annotatableIReadOnlyAnnotatableThe annotatable to search for PostgresExtension annotations.
Returns
- IEnumerable<PostgresExtension>
The collection of PostgresExtension stored in the IAnnotatable.
Exceptions
- ArgumentNullException
annotatable