33 lines
1020 B
C#
33 lines
1020 B
C#
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();
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|