Class NpgsqlFactory
- Namespace
- Npgsql
- Assembly
- Npgsql.dll
A factory to create instances of various Npgsql objects.
[Serializable]
public sealed class NpgsqlFactory : DbProviderFactory, IServiceProvider
- Inheritance
-
NpgsqlFactory
- Implements
- Inherited Members
Fields
Instance
Gets an instance of the NpgsqlFactory. This can be used to retrieve strongly typed data objects.
public static readonly NpgsqlFactory Instance
Field Value
Properties
CanCreateBatch
Gets a value that indicates whether this DbProviderFactory instance supports the DbBatch class.
public override bool CanCreateBatch { get; }
Property Value
CanCreateCommandBuilder
Specifies whether the specific DbProviderFactory supports the DbCommandBuilder class.
public override bool CanCreateCommandBuilder { get; }
Property Value
CanCreateDataAdapter
Specifies whether the specific DbProviderFactory supports the DbDataAdapter class.
public override bool CanCreateDataAdapter { get; }
Property Value
Methods
CreateBatch()
Returns a new instance of the provider's class that implements the DbBatch class.
public override DbBatch CreateBatch()
Returns
CreateBatchCommand()
Returns a new instance of the provider's class that implements the DbBatchCommand class.
public override DbBatchCommand CreateBatchCommand()
Returns
- DbBatchCommand
A new instance of DbBatchCommand.
CreateCommand()
Returns a strongly typed DbCommand instance.
public override DbCommand CreateCommand()
Returns
CreateCommandBuilder()
Returns a strongly typed DbCommandBuilder instance.
public override DbCommandBuilder CreateCommandBuilder()
Returns
CreateConnection()
Returns a strongly typed DbConnection instance.
public override DbConnection CreateConnection()
Returns
CreateConnectionStringBuilder()
Returns a strongly typed DbConnectionStringBuilder instance.
public override DbConnectionStringBuilder CreateConnectionStringBuilder()
Returns
CreateDataAdapter()
Returns a strongly typed DbDataAdapter instance.
public override DbDataAdapter CreateDataAdapter()
Returns
CreateDataSource(string)
Returns a new instance of the provider's class that implements the DbDataSource class, representing the database for the given connection string and ready to hand out connections to it.
public override DbDataSource CreateDataSource(string connectionString)
Parameters
connectionString
stringThe connection string of the database to be represented by this DbDataSource. The exact contents of the connection string depend on the specific data source for this connection.
Returns
- DbDataSource
A new instance of DbDataSource.
CreateParameter()
Returns a strongly typed DbParameter instance.
public override DbParameter CreateParameter()
Returns
GetService(Type)
Gets the service object of the specified type.
public object? GetService(Type serviceType)
Parameters
serviceType
TypeAn object that specifies the type of service object to get.
Returns
- object
A service object of type serviceType, or null if there is no service object of type serviceType.