我想知道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();
}
}