31 lines
823 B
C#
31 lines
823 B
C#
using BlueWest.Data;
|
|
using Microsoft.EntityFrameworkCore;
|
|
|
|
namespace BlueWest.WebApi.MySQL
|
|
{
|
|
/// <summary>
|
|
/// Finance operations table
|
|
/// </summary>
|
|
public class FinanceDbContext : DbContext
|
|
{
|
|
public DbSet<FinanceOp> Transactions { get; set; }
|
|
public DbSet<FinanceOpType> TransactionTypes { get; set; }
|
|
|
|
/// <summary>
|
|
/// Finance transactions context
|
|
/// </summary>
|
|
/// <param name="options"></param>
|
|
public FinanceDbContext(DbContextOptions<FinanceDbContext> options) : base(options)
|
|
{
|
|
Database.EnsureCreated();
|
|
}
|
|
|
|
protected override void OnModelCreating(ModelBuilder modelBuilder)
|
|
{
|
|
base.OnModelCreating(modelBuilder);
|
|
modelBuilder.ProjectDatabaseModel();
|
|
}
|
|
}
|
|
}
|
|
|