Class SqlServerIdGeneratorFactory
Creates an instances of SqlServerIdGenerator for specified database.
Inheritance
System.Object
SqlServerIdGeneratorFactory
Implements
Namespace: Kros.Data.SqlServer
Assembly: Kros.Utils.dll
Syntax
public class SqlServerIdGeneratorFactory : IIdGeneratorFactory
Examples
Constructors
SqlServerIdGeneratorFactory(SqlConnection)
Initializes a new instance of the SqlServerIdGeneratorFactory class.
Declaration
public SqlServerIdGeneratorFactory(SqlConnection connection)
Parameters
Type | Name | Description |
---|---|---|
System.Data.SqlClient.SqlConnection | connection | Database connection. ID generators create IDs for tables in this database. |
SqlServerIdGeneratorFactory(String)
Initializes a new instance of the SqlServerIdGeneratorFactory class.
Declaration
public SqlServerIdGeneratorFactory(string connectionString)
Parameters
Type | Name | Description |
---|---|---|
System.String | connectionString | Database connection string. ID generators create IDs for tables in this database. |
Methods
GetGenerator(String)
Declaration
public IIdGenerator GetGenerator(string tableName)
Parameters
Type | Name | Description |
---|---|---|
System.String | tableName |
Returns
Type | Description |
---|---|
IIdGenerator |
GetGenerator(String, Int32)
Declaration
public IIdGenerator GetGenerator(string tableName, int batchSize)
Parameters
Type | Name | Description |
---|---|---|
System.String | tableName | |
System.Int32 | batchSize |
Returns
Type | Description |
---|---|
IIdGenerator |
Register()
Registers factory methods for creating an instance of factory into IdGeneratorFactories.
Declaration
public static void Register()