using BlueWest.Data; using BlueWest.WebApi.EF.Model; using MapTo; using Microsoft.EntityFrameworkCore; namespace BlueWest.WebApi.EF { /// /// Context for accessing company data /// public sealed class CompanyDbContext : DbContext { /// /// Companies. /// public DbSet Companies { get; set; } /// /// Industries. /// public DbSet Industries { get; set; } /// /// Products. /// public DbSet Products { get; set; } /// /// CompanyDbContext constructor. /// /// public CompanyDbContext(DbContextOptions options) : base(options) { Database.EnsureCreated(); } /// /// On model creating. /// /// Builder model of the database protected override void OnModelCreating(ModelBuilder modelBuilder) { base.OnModelCreating(modelBuilder); modelBuilder.ConfigureCurrentDbModel(); } } }