LFlow/LFlow.Home/HomeModule.cs

31 lines
955 B
C#
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

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");
}
}