mirror of
https://gitee.com/langsisi_admin/serein-flow
synced 2026-03-18 07:26:34 +08:00
重写IOC容器绑定逻辑
This commit is contained in:
@@ -31,10 +31,7 @@ namespace Serein.Library.Web
|
||||
{
|
||||
private readonly ISereinIOC SereinIOC; // 用于存储路由信息
|
||||
|
||||
public Router(ISereinIOC SereinIOC)
|
||||
{
|
||||
this.SereinIOC = SereinIOC;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 控制器实例对象的类型,每次调用都会重新实例化,[Url - ControllerType]
|
||||
/// </summary>
|
||||
@@ -50,9 +47,9 @@ namespace Serein.Library.Web
|
||||
|
||||
//private Type PostRequest;
|
||||
|
||||
public Router()
|
||||
public Router(ISereinIOC SereinIOC)
|
||||
{
|
||||
|
||||
this.SereinIOC = SereinIOC;
|
||||
_routes = new ConcurrentDictionary<string, ConcurrentDictionary<string, MethodInfo>>(); // 初始化路由字典
|
||||
_controllerTypes = new ConcurrentDictionary<string, Type>(); // 初始化控制器实例对象字典
|
||||
foreach (API method in Enum.GetValues(typeof(API))) // 遍历 HTTP 枚举类型的所有值
|
||||
|
||||
Reference in New Issue
Block a user