public VendaRepository(IDatabaseConfig config) { DapperNodaTimeSetup.Register(); _action = config.DbAction; _itemVendaDataAccess = new ItemVendaDataAccess(); _tableVenda = DatabaseUtils.Table <Venda>(); _tableItemVenda = DatabaseUtils.Table <ItemVenda>(); _tableDisco = DatabaseUtils.Table <Disco>(); }
private void WithDatabase(IEmbeddedConfiguration config, IDatabaseAction action) { IObjectContainer db = Db4oEmbedded.OpenFile(config, TempFile()); try { action.RunWith(db); } finally { db.Close(); } }
private void WithDatabase(IDatabaseAction action) { WithDatabase(NewConfiguration(), action); }
public PostgresDatabase() { Connection = new NpgsqlConnection(); DbAction = new DatabaseAction(Connection); }
public DiscoRepository(IDatabaseConfig config) { _action = config.DbAction; _tableDisco = DatabaseUtils.Table <Disco>(); }
public InMemoryDatabase() { Connection = new SQLiteConnection("Data Source=:memory:; Version=3;"); DbAction = new InMemoryDatabaseAction(this); }