using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Design; namespace MiaoJiZhang.Infrastructure.Persistence; public sealed class AppDbContextFactory : IDesignTimeDbContextFactory { public AppDbContext CreateDbContext(string[] args) { var options = new DbContextOptionsBuilder() .UseMySql( "Server=127.0.0.1;Database=miaoji_design;User=design;Password=design;", new MySqlServerVersion(new Version(8, 0, 36))) .Options; return new AppDbContext(options); } }