You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

20 lines
641 B
C#

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);
}
}
}