CodeLiturgy.Dashboard/BlueWest.Api/MySQL/CountriesDbContext.cs

37 lines
842 B
C#

using BlueWest.Data;
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Configuration;
namespace BlueWest.WebApi.MySQL;
public class CountriesDbContext : DbContext
{
public DbSet<Country> Countries { get; set; }
public DbSet<Currency> Currencies { get; set; }
public IConfiguration Configuration;
public CountriesDbContext(DbContextOptions<UserDbContext> 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)
{
}
}