31 lines
955 B
C#
31 lines
955 B
C#
using System;
|
||
using System.Reflection;
|
||
using LFlow.Base.BusinessInterface;
|
||
using LFlow.Base.Interfaces;
|
||
using LFlow.Base.Utils;
|
||
using LFlow.Home.Models.DataModels;
|
||
using LFlow.Home.Models.DtoModel;
|
||
using LFlow.Home.Services;
|
||
using Microsoft.Extensions.DependencyInjection;
|
||
|
||
namespace LFlow.Home;
|
||
|
||
public class HomeModule : IModule
|
||
{
|
||
public void ConfigureModule(IServiceCollection services)
|
||
{
|
||
// 将HomeModel注册到CodeFirst,将会在程序启动后自动创建表
|
||
CodeFirst.AddType(typeof(HomeModel));
|
||
|
||
var assembly = Assembly.GetAssembly(typeof(HomeService))!;
|
||
var types = assembly.GetTypes().ToList();
|
||
RegisterModule.RegisterAllService(types, services);
|
||
RegisterModule.RegisterAllRepo(types, services);
|
||
RegisterModule.RegisterAllModule(types, services);
|
||
services.AddControllers().AddApplicationPart(assembly);
|
||
Console.WriteLine("HomeModule ConfigureModule");
|
||
|
||
}
|
||
|
||
}
|