using BlueWest.Data;
using BlueWest.WebApi.EF.Model;
using Microsoft.EntityFrameworkCore;
namespace BlueWest.WebApi.EF
{
///
/// Finance operations table
///
internal sealed class FinanceDbContext : DbContext
{
[DatabaseFundamentals(typeof(FinanceDbContext), typeof(FinanceOp))]
internal DbSet Transactions { get; set; }
[DatabaseFundamentals(typeof(FinanceDbContext), typeof(FinanceOpType))]
internal DbSet TransactionTypes { get; set; }
///
/// Finance transactions context
///
///
internal FinanceDbContext(DbContextOptions options) : base(options)
{
Database.EnsureCreated();
}
protected override void OnModelCreating(ModelBuilder modelBuilder)
{
base.OnModelCreating(modelBuilder);
modelBuilder.ConfigureCurrentDbModel();
}
}
}