去除引用common.props
This commit is contained in:
@@ -1,13 +1,6 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.AspNetCore.Mvc.Controllers;
|
||||
using Microsoft.CodeAnalysis.CSharp.Syntax;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Tnb.WarehouseMgr.Interfaces;
|
||||
|
||||
namespace Tnb.WarehouseMgr
|
||||
{
|
||||
@@ -15,22 +8,22 @@ namespace Tnb.WarehouseMgr
|
||||
{
|
||||
public object Create(ControllerContext context)
|
||||
{
|
||||
if(context == null) { throw new ArgumentNullException("context"); }
|
||||
if (context == null) { throw new ArgumentNullException("context"); }
|
||||
var controllerType = context.ActionDescriptor.ControllerTypeInfo.AsType();
|
||||
//获取Controller实例
|
||||
var controller =context.HttpContext.RequestServices.GetRequiredService(controllerType);
|
||||
var controller = context.HttpContext.RequestServices.GetRequiredService(controllerType);
|
||||
//判断是否继承了自定义Controller基类
|
||||
//if(controller is BaseWareHouseService basedWhSvc)
|
||||
//{
|
||||
// basedWhSvc.WareHouseSrv = context.HttpContext.RequestServices.GetRequiredService<IWareHouseService>();
|
||||
//}
|
||||
return controller;
|
||||
return controller;
|
||||
|
||||
}
|
||||
|
||||
public void Release(ControllerContext context, object controller)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user