# Class NpgsqlDatabaseModelFactory

Namespace
  Npgsql.EntityFrameworkCore.PostgreSQL.Scaffolding.Internal

Assembly
  Npgsql.EntityFrameworkCore.PostgreSQL.dll

The default database model factory for Npgsql.

    public class NpgsqlDatabaseModelFactory : DatabaseModelFactory, IDatabaseModelFactory

Inheritance
  object
  DatabaseModelFactory
  NpgsqlDatabaseModelFactory

Implements
  IDatabaseModelFactory

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

## Constructors

### NpgsqlDatabaseModelFactory(IDiagnosticsLogger<Scaffolding>)

Constructs an instance of the NpgsqlDatabaseModelFactory class.

    public NpgsqlDatabaseModelFactory(IDiagnosticsLogger<DbLoggerCategory.Scaffolding> logger)

#### Parameters

`logger` IDiagnosticsLogger<DbLoggerCategory.Scaffolding>

## Methods

### Create(DbConnection, DatabaseModelFactoryOptions)

Connects to the database using the given connection and creates a DatabaseModel for the database.

    public override DatabaseModel Create(DbConnection dbConnection, DatabaseModelFactoryOptions options)

#### Parameters

`dbConnection` DbConnection
`options` DatabaseModelFactoryOptions

  The options specifying which metadata to read.

#### Returns

DatabaseModel

  The database model.

### Create(string, DatabaseModelFactoryOptions)

Connects to the database using the given connection string and creates a DatabaseModel for the database.

    public override DatabaseModel Create(string connectionString, DatabaseModelFactoryOptions options)

#### Parameters

`connectionString` string

  The connection string for the database to reverse engineer.

`options` DatabaseModelFactoryOptions

  The options specifying which metadata to read.

#### Returns

DatabaseModel

  The database model.