DbProviderUtils ​
Namespace: MJCZone.DapperMatic.Providers
Assembly: MJCZone.DapperMatic
Summary ​
Utility class for generating database constraint and index names.
static
public
Contents ​
Methods (11)
Methods ​
Method | Summary |
---|---|
GenerateCheckConstraintName | Generates a check constraint name. |
GenerateDefaultConstraintName | Generates a default constraint name. |
GenerateUniqueConstraintName | Generates a unique constraint name. |
GeneratePrimaryKeyConstraintName | Generates a primary key constraint name. |
GenerateIndexName | Generates an index name. |
GenerateForeignKeyConstraintName | Generates a foreign key constraint name. |
GenerateForeignKeyConstraintName | Generates a foreign key constraint name. |
GetType | |
ToString | |
Equals | |
GetHashCode |
GenerateCheckConstraintName ​
Generates a check constraint name.
csharp
string GenerateCheckConstraintName(string tableName, string columnName)
Parameters ​
- tableName (string) - The name of the table.
- columnName (string) - The name of the column.
Returns ​
Type: string
The generated check constraint name.
GenerateDefaultConstraintName ​
Generates a default constraint name.
csharp
string GenerateDefaultConstraintName(string tableName, string columnName)
Parameters ​
- tableName (string) - The name of the table.
- columnName (string) - The name of the column.
Returns ​
Type: string
The generated default constraint name.
GenerateUniqueConstraintName ​
Generates a unique constraint name.
csharp
void GenerateUniqueConstraintName(string tableName, String[] columnNames)
Parameters ​
- tableName (string) - The name of the table.
- columnNames (String[]) - The names of the columns.
Returns ​
The generated unique constraint name.
GeneratePrimaryKeyConstraintName ​
Generates a primary key constraint name.
csharp
void GeneratePrimaryKeyConstraintName(string tableName, String[] columnNames)
Parameters ​
- tableName (string) - The name of the table.
- columnNames (String[]) - The names of the columns.
Returns ​
The generated primary key constraint name.
GenerateIndexName ​
Generates an index name.
csharp
void GenerateIndexName(string tableName, String[] columnNames)
Parameters ​
- tableName (string) - The name of the table.
- columnNames (String[]) - The names of the columns.
Returns ​
The generated index name.
GenerateForeignKeyConstraintName ​
Generates a foreign key constraint name.
csharp
string GenerateForeignKeyConstraintName(string tableName, string columnName, string refTableName, string refColumnName)
Parameters ​
- tableName (string) - The name of the table.
- columnName (string) - The name of the column.
- refTableName (string) - The name of the referenced table.
- refColumnName (string) - The name of the referenced column.
Returns ​
Type: string
The generated foreign key constraint name.
GenerateForeignKeyConstraintName ​
Generates a foreign key constraint name.
csharp
void GenerateForeignKeyConstraintName(string tableName, String[] columnNames, string refTableName, String[] refColumnNames)
Parameters ​
- tableName (string) - The name of the table.
- columnNames (String[]) - The names of the columns.
- refTableName (string) - The name of the referenced table.
- refColumnNames (String[]) - The names of the referenced columns.
Returns ​
The generated foreign key constraint name.
GetType ​
csharp
void GetType()
ToString ​
csharp
void ToString()
Equals ​
csharp
void Equals()
GetHashCode ​
csharp
void GetHashCode()