Class WMDbContextUtils
Inheritance
WMDbContextUtils
Assembly: WMServer.dll
Syntax
public class WMDbContextUtils
Constructors
WMDbContextUtils(ModelBuilder, bool)
Create a new instance and set the ModelBuilder reference.
Declaration
public WMDbContextUtils(ModelBuilder mb, bool setDbEntityKey = true)
Parameters
Methods
CreateDbContext<T>(string)
Declaration
public static DbContext CreateDbContext<T>(string connectionString) where T : DbContext
Parameters
Type |
Name |
Description |
string |
connectionString |
|
Returns
Type Parameters
MapToTable<T>(string?)
Standard mapping of a World Modeler class that inherits from IDbEntity.
Declaration
public EntityTypeBuilder<T> MapToTable<T>(string? tableName = null) where T : class
Parameters
Type |
Name |
Description |
string |
tableName |
Optional table name. If not specified or null, the class name of the T parameter will be used.
|
Returns
Type Parameters
Name |
Description |
T |
The .NET model type to map to the specified table
|
NewID()
Create a new GUID to use as an object ID.
Declaration
public static string NewID()
Returns
SetKey<T>(string[]?)
Set the column(s) that will be the key for the table generated for the class specified in the T parameter.
Declaration
public EntityTypeBuilder<T> SetKey<T>(string[]? key = null) where T : class
Parameters
Type |
Name |
Description |
string[] |
key |
|
Returns
Type Parameters