使用IOC获取定义的数据服务

This commit is contained in:
liming 蔡
2026-07-14 19:24:01 +08:00
parent 8c6c9a5dc1
commit 4e6992b78c
3 changed files with 9 additions and 10 deletions
+1 -1
View File
@@ -20,7 +20,7 @@ namespace JY.DAL
var services = new ServiceCollection();
//services.AddScoped(typeof(IRepository<>), typeof(Repository<>));
services.AddScoped(typeof(IRepository<>), typeof(Repository<>));
services.AddScoped<IRepository<BlankingData>, Repository<BlankingData>>();
//services.AddScoped<IRepository<BlankingData>, Repository<BlankingData>>();
services.AddScoped<IAlarmDataService, AlarmDataService>();
services.AddScoped<IBlankingDataService, BlankingDataService>();