-
Notifications
You must be signed in to change notification settings - Fork 767
Closed
Labels
Milestone
Description
您的功能请求与现有问题有关吗?请描述
EntityFrameworkCorePackBase
中强行注入DefaultDbContext
不合理,如果不使用DefaultDbContext
的时候,会造成混乱
描述您想要的需求方案
-
移除
EntityFrameworkCorePackBase
中的上下文注入public abstract class EntityFrameworkCorePackBase : OsharpPack { public override IServiceCollection AddServices(IServiceCollection services) { // services.AddOsharpDbContext<DefaultDbContext>(); } }
-
改到
MigrationPackBase<TDbContext>
基类中执行上下文类型的注入public abstract class MigrationPackBase<TDbContext> : OsharpPack where TDbContext : DbContext { public override IServiceCollection AddServices(IServiceCollection services) { services.AddOsharpDbContext<TDbContext>(); return services; } }