using BlueWest.Data; using BlueWest.WebApi.EF.Model; using Microsoft.EntityFrameworkCore; using Microsoft.Extensions.Configuration; namespace BlueWest.WebApi.EF { internal sealed class UserDbContext : DbContext { internal DbSet Users { get; set; } internal IConfiguration Configuration; /// /// Database for the context of database users /// /// internal UserDbContext(DbContextOptions options) : base(options) { Database.EnsureCreated(); } protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder) { /*optionsBuilder.UseMySql( Configuration.GetConnectionString("LocalMySQL"), new MySqlServerVersion(new Version(8, 0, 11)) );*/ } protected override void OnModelCreating(ModelBuilder modelBuilder) { base.OnModelCreating(modelBuilder); modelBuilder.ConfigureCurrentDbModel(); } } }