LFlow/LFlow.OnlineManegement/OnlineManegementModule.cs

29 lines
1.0 KiB
C#
Raw Normal View History

2024-10-19 08:33:19 +08:00
using LFlow.Base.Interfaces;
using LFlow.Base.Utils;
using LFlow.OnlineManegement.Model;
using Microsoft.Extensions.DependencyInjection;
using Serilog;
using System.Reflection;
namespace LFlow.OnlineManegement
{
public class OnlineManegementModule : IModule
{
public void ConfigureModule(IServiceCollection services)
{
// 将模型添加到需要初始化数据库表的队列中
CodeFirst.AddType(typeof(OnlineModel));
// 获取当前程序集
var assembly = Assembly.GetAssembly(typeof(OnlineManegementModule))!;
var types = assembly.GetTypes().ToList();
//注册服务
RegisterModule.RegisterAllService(types, services);
//注册仓储
RegisterModule.RegisterAllRepo(types, services);
//RegisterModule.RegisterAllModel(types, services);
services.AddControllers().AddApplicationPart(assembly);
Log.Logger?.Information("OnlineManegementModule ConfigureModule done");
}
}
}