using Microsoft.EntityFrameworkCore;

namespace WebMVCApi.config
{
    public class HaloDbContext : DbContext
    {

        protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder) {
            optionsBuilder.UseMySql("server=local.wuanwanghao.top;port=3307;user=root;password=ks125930.;database=blog-db",
                new MySqlServerVersion(new Version(5, 7, 35)));

        }
        protected override void OnModelCreating(ModelBuilder modelBuilder)
        {
            base.OnModelCreating(modelBuilder);
            modelBuilder.ApplyConfigurationsFromAssembly(this.GetType().Assembly);
        }
    }
}
