# Class PostgresExtension

Namespace
  Npgsql.EntityFrameworkCore.PostgreSQL.Metadata

Assembly
  Npgsql.EntityFrameworkCore.PostgreSQL.dll

Represents the metadata for a PostgreSQL extension.

    public class PostgresExtension

Inheritance
  object
  PostgresExtension

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 extension.

    public virtual Annotatable Annotatable { get; }

#### Property Value

Annotatable

### Name

The extension name.

    public virtual string Name { get; }

#### Property Value

string

### Schema

The extension schema or null to represent the default schema.

    public virtual string? Schema { get; }

#### Property Value

string

### Version

The extension version.

    public virtual string? Version { get; set; }

#### Property Value

string

## 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

`annotatable` IReadOnlyAnnotatable

  The annotatable to search for the extension.

`schema` string

  The extension schema. The default schema is never used.

`name` string

  The 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

`annotatable` IConventionAnnotatable

  The annotatable from which to get or add the extension.

`schema` string

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

`name` string

  The extension name.

`version` string

  The 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

`annotatable` IMutableAnnotatable

  The annotatable from which to get or add the extension.

`name` string

  The extension name.

`version` string

  The 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

`annotatable` IMutableAnnotatable

  The annotatable from which to get or add the extension.

`schema` string

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

`name` string

  The extension name.

`version` string

  The 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

`annotatable` IReadOnlyAnnotatable

  The annotatable to search for PostgresExtension annotations.

#### Returns

IEnumerable<PostgresExtension>

  The collection of PostgresExtension stored in the IAnnotatable.

#### Exceptions

ArgumentNullException

  `annotatable`