zoukankan      html  css  js  c++  java
  • 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;
            }
  • 相关阅读:
    Exchanger
    信号量Semaphore
    CountDownLatch
    Condition
    WCF接口实例介绍
    时间显示
    pymysql-execute
    python之迭代器与生成器
    python之装饰器
    python之函数
  • 原文地址:https://www.cnblogs.com/wangyinlon/p/10903951.html
Copyright © 2011-2022 走看看