using BlueWest.Data;
using BlueWest.Domain.Model;
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Configuration;
namespace BlueWest.Domain
{
///
/// 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();
}
}
}