ASP.NET 获取area_controller_Action_Parameters
获取
var areaName = filterContext.RouteData.DataTokens["area"] + "/"; //获取当前区域 var controllerName = filterContext.RouteData.Values["controller"] + "/"; //获取控制器 var action = filterContext.RouteData.Values["Action"]; //获取当前Action string currentUrl = "/" + areaName + controllerName + action; //拼接构造完整url var auditInfo = _auditingHelper.CreateAuditInfo( context.ActionDescriptor.AsControllerActionDescriptor().ControllerTypeInfo.AsType(), context.ActionDescriptor.AsControllerActionDescriptor().MethodInfo, context.ActionArguments ); public AuditInfo CreateAuditInfo(Type type, MethodInfo method, IDictionary<string, object> arguments) { var auditInfo = new AuditInfo { TenantId = AbpSession.TenantId, UserId = AbpSession.UserId, ImpersonatorUserId = AbpSession.ImpersonatorUserId, ImpersonatorTenantId = AbpSession.ImpersonatorTenantId, ServiceName = type != null ? type.FullName : "", MethodName = method.Name, Parameters = ConvertArgumentsToJson(arguments), ExecutionTime = Clock.Now }; try { _auditInfoProvider.Fill(auditInfo); } catch (Exception ex) { Logger.Warn(ex.ToString(), ex); } return auditInfo; }
作者:银龙
-------------------------------------------
个性签名:独学而无友,则孤陋而寡闻。做一个灵魂有趣的人!
如果觉得这篇文章对你有小小的帮助的话,记得在右下角点个“推荐”哦,博主在此感谢!
万水千山总是情,打赏一分行不行,所以如果你心情还比较高兴,也是可以扫码打赏博主,哈哈哈(っ•̀ω•́)っ✎⁾⁾!