public UserContext() : base(new SQLiteConnection() { ConnectionString = connectionString },true)
{
DbConfiguration.SetConfiguration(new SQLiteConfiguration());
}
public DbSet<Valve> Valves { get; set; }
}
public class SQLiteConfiguration : DbConfiguration
{
public SQLiteConfiguration()
{
SetProviderFactory("System.Data.SQLite", SQLiteFactory.Instance);
SetProviderFactory("System.Data.SQLite.EF6", SQLiteProviderFactory.Instance);
SetProviderServices("System.Data.SQLite", (DbProviderServices)SQLiteProviderFactory.Instance.GetService(typeof(DbProviderServices)));
}
}