using BlueWest.Data; using BlueWest.WebApi.Context.Users; using BlueWest.WebApi.EF.Model; using Microsoft.EntityFrameworkCore; using Microsoft.Extensions.Configuration; namespace BlueWest.WebApi.EF { /// /// Database context for app users /// public sealed class UserDbContext : DbContext { /// /// Users entity. /// public DbSet Users { get; set; } /// /// App configuration. /// public IConfiguration Configuration; /// /// Database for the context of database users /// /// public UserDbContext(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(); } } }