一.WebAPI自定义过滤器的使用 1.注册过滤器 using System.Web.Http; using KYINT.WebAPIService.Handler; namespace KYINT.WebAPIService { public static class WebApiConfig { public static void Register(HttpConfiguration config) { // Web API 配置和服务 // Web API 路由 config.MapHt
public class GlobalActionFilter : ActionFilterAttribute { private string _requestId; public override void OnActionExecuting(HttpActionContext actionContext) { base.OnActionExecuting(actionContext); //方法1. var gaf=actionContext.ActionDescriptor.GetCu
代码: using System; using System.Collections.Generic; using System.IO; using System.Linq; using System.Security.Principal; using System.Threading; using System.Threading.Tasks; using System.Web; using System.Web.Http.Controllers; using System.Web.Http.