DbConnectionString<T, TBuilder>
Class DbConnectionString<T, TBuilder>
IDbConnectionString base
Inheritance
Implements
Inherited Members
Namespace: ETLBox
Assembly: ETLBox.dll
Syntax
public abstract class DbConnectionString<T, TBuilder> : IDbConnectionString where T : DbConnectionString<T, TBuilder>, new() where TBuilder : DbConnectionStringBuilder, new()Type Parameters
| Name | Description |
|---|---|
| T | Derived type |
| TBuilder | The underlying ADO.NET connection string builder |
Constructors
DbConnectionString()
Declaration
public DbConnectionString()DbConnectionString(string)
Declaration
protected DbConnectionString(string value)Parameters
| Type | Name | Description |
|---|---|---|
| string | value |
Properties
Builder
The underlying ADO.NET ConnectionStringBuilder
Declaration
public TBuilder Builder { get; }Property Value
| Type | Description |
|---|---|
| TBuilder |
DbName
The database name
Declaration
public abstract string DbName { get; set; }Property Value
| Type | Description |
|---|---|
| string |
DbNameKeyword
The keyword used in the connection string to identify a database
Declaration
protected abstract string DbNameKeyword { get; }Property Value
| Type | Description |
|---|---|
| string |
MasterDbName
The name of the master database (if applicable)
Declaration
public abstract string MasterDbName { get; }Property Value
| Type | Description |
|---|---|
| string |
Value
The connection string value, e.g. "Server=localhost;Database=etlbox;"
Declaration
public virtual string Value { get; set; }Property Value
| Type | Description |
|---|---|
| string |
Methods
Clone()
Clones the current connection string
Declaration
public virtual T Clone()Returns
| Type | Description |
|---|---|
| T | A copy of the current connection string |
CloneWithMasterDbName()
Clones the current connection string with the master database name (if applicable)
Declaration
public virtual T CloneWithMasterDbName()Returns
| Type | Description |
|---|---|
| T | The new connection string with master database name |
CloneWithNewDbName(string)
Clone the current connection string with a new database name
Declaration
public virtual T CloneWithNewDbName(string value)Parameters
| Type | Name | Description |
|---|---|---|
| string | value | The new database name |
Returns
| Type | Description |
|---|---|
| T | The new connection string |
CloneWithoutDbName()
Clones the current connection string with removing the database name
Declaration
public virtual T CloneWithoutDbName()Returns
| Type | Description |
|---|---|
| T | The new connection string without database name |
ToString()
Returns the connection string Value
Declaration
public override string ToString()Returns
| Type | Description |
|---|---|
| string | The new connection string |