本文整理汇总了C#中System.Web.Mvc.ActionExecutingContext.HasMarkerAttribute方法的典型用法代码示例。如果您正苦于以下问题:C# ActionExecutingContext.HasMarkerAttribute方法的具体用法?C# ActionExecutingContext.HasMarkerAttribute怎么用?C# ActionExecutingContext.HasMarkerAttribute使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Web.Mvc.ActionExecutingContext
的用法示例。
在下文中一共展示了ActionExecutingContext.HasMarkerAttribute方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: OnActionExecuting
/// <summary>
///
/// </summary>
/// <param name="filterContext"></param>
public override void OnActionExecuting(ActionExecutingContext filterContext)
{
ServiceContainer.Resolve<IInitRequestScopeContext>().BeginRequest(filterContext.HttpContext.Request);
if (!filterContext.HasMarkerAttribute<NonTracingAttribute>())
{
var request = filterContext.HttpContext.Request;
var response = filterContext.HttpContext.Response;
Header reqHeader = TracingContextData.GetDefaultRequestHeader();
TracingContextData.SetSubRpcID(reqHeader.RpcID + ".0");
TracingContextData.SetRequestHeader(reqHeader);
if (!filterContext.HasMarkerAttribute<NotToLogAttribute>())
{
TraceLogs trace = new TraceLogs();
trace.ContextType = ContextType.Server.ToString();
trace.StartTime = DateTime.Now;
trace.MachineAddr = Util.TracingContextHelper.GetServerAddress();
trace.TraceId = reqHeader.TraceID;
trace.RpcId = reqHeader.RpcID;
trace.Protocol = request.Url.Scheme;
trace.Environment = this.environment ?? EnvironmentConfig.Environment;
trace.SystemID = this.systemID ?? EnvironmentConfig.SystemID;
trace.SystemName = this.systemName ?? EnvironmentConfig.SystemName;
//srs.InvokeID = string.Format("{0}_{1}", filterContext.ActionDescriptor.ControllerDescriptor.ControllerName.ToLower(), filterContext.ActionDescriptor.ActionName.ToLower());
//InvokeID
trace.InvokeID = request.Url.AbsolutePath;
string folder = filterContext.HttpContext.Request.Headers[Config.ResponseHeaderFolderKey];
if (!string.IsNullOrWhiteSpace(folder))
{
trace.ServerHost = request.Url.Host + folder;
}
else
{
trace.ServerHost = request.Url.Host;
}
TraceExtensionOnActionExecuting(filterContext, trace);
Util.TracingContextHelper.SetContextItem(Config.ServerRSKey, trace);
}
}
base.OnActionExecuting(filterContext);
}