我想知道SQLiteConnectionContext類的MySQL等價物是什麼。我需要這個能夠爲我的程序擁有一個通用的連接上下文。我正在創建一個基於實體的解決方案,它將推送和從MySQL數據庫中提取數據。如果有更好的方式來做到這一點,我也會接受。以下是我正在尋找的SQLite版本。MySQL的等價SQLite SQLiteConnectionContext
/// <summary>
/// A ConnectionContext common for all of the Inventory project
/// </summary>
public class InventoryConnectionContext : SQLiteConnectionContext
{
public InventoryConnectionContext(bool connect = true)
: base(InventoryConnectionString, connect)
{
}
/// <summary>
/// Constructs a BudgetConnectionContext and optionally opens the connection
/// </summary>
/// <param name="connectString">Connection string that points to a connection aside from the default connection</param>
/// <param name="connect">Specifies whether or not to open the connection</param>
public InventoryConnectionContext(string connectString, bool connect = true)
: base(connectString)
{
if (connect)
Connect();
}
}