using BlueWest.Data; using BlueWest.WebApi.EF.Model; using Microsoft.EntityFrameworkCore; using Microsoft.Extensions.Configuration; namespace BlueWest.WebApi.EF { /// /// Countries and Currencies /// public sealed class CountryDbContext : DbContext { /// /// Countries Database Table /// public DbSet Countries { get; set; } /// /// Currencies Database Table /// public DbSet Currencies { get; set; } /// /// App Configuration /// public IConfiguration Configuration; /// /// CountryDbContext Constructor. /// /// public CountryDbContext(DbContextOptions options) : base(options) { Database.EnsureCreated(); } /// /// On model creating. /// /// protected override void OnModelCreating(ModelBuilder modelBuilder) { base.OnModelCreating(modelBuilder); modelBuilder.ConfigureCurrentDbModel(); } } }