添加项目文件。

This commit is contained in:
2026-04-30 21:08:28 +08:00
parent c60f5fe117
commit cc017b6495
327 changed files with 12860 additions and 0 deletions
@@ -0,0 +1,18 @@
using IM.InitCommon;
using MessageService.Infrastructure;
using Microsoft.EntityFrameworkCore.Design;
namespace MessageService.WebApi
{
public class DesignTimeDbContextFactory : IDesignTimeDbContextFactory<MessageDbContext>
{
public MessageDbContext CreateDbContext(string[] args)
{
// 1. 复用你写好的配置工厂,提取连接字符串
var optionsBuilder = DbContextOptionsBuilderFactory.Create<MessageDbContext>();
// 2. 🌟 关键补刀:把假的 Mediator 传进去,满足构造函数的要求!
return new MessageDbContext(optionsBuilder.Options, null);
}
}
}