添加项目文件。
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
using JY.DAL.Repository;
|
||||
using JY.DAL.Service;
|
||||
using JY.Model;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using SqlSugar;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace JY.DAL
|
||||
{
|
||||
public static class IocConfig
|
||||
{
|
||||
public static ServiceProvider Provider { get; private set; }
|
||||
|
||||
public static void Initialize()
|
||||
{
|
||||
var services = new ServiceCollection();
|
||||
//services.AddScoped(typeof(IRepository<>), typeof(Repository<>));
|
||||
services.AddScoped(typeof(IRepository<>), typeof(Repository<>));
|
||||
services.AddScoped<IRepository<BlankingData>, Repository<BlankingData>>();
|
||||
|
||||
services.AddScoped<IAlarmDataService, AlarmDataService>();
|
||||
services.AddScoped<IBlankingDataService, BlankingDataService>();
|
||||
services.AddScoped<IFeedingDataService, FeedingDataService>();
|
||||
|
||||
Provider = services.BuildServiceProvider();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user