public override void OnActionExecuting(ActionExecutingContext context) { string test = context.Controller.ToString(); if (ValuesController._flag == 0) { context.Result = new RedirectResult("/api/values/Test"); ValuesController._flag = 1; } }
学习博客:http://www.cnblogs.com/niklai/p/5676632.html
http://www.cnblogs.com/wangrudong003/p/5750583.html