public override void OnActionExecuting(HttpActionContext actionContext)
        {
            if (EFWCoreLib.WcfFrame.ServerController.WcfServerManage.IsDebug)
            {
                var stopWatch = new Stopwatch();
                actionContext.Request.Properties[Key] = stopWatch;
                stopWatch.Start();

                WebApiSelfHosting.ShowHostMsg(Color.Black, DateTime.Now, "WebApi开始执行:[" + actionContext.Request.RequestUri.LocalPath + "]");
            }
        }
        public override void OnException(HttpActionExecutedContext context)
        {
            var message = context.Exception.Message;

            if (context.Exception.InnerException != null)
            {
                message = context.Exception.InnerException.Message;
            }

            WebApiSelfHosting.ShowHostMsg(Color.Red, DateTime.Now, "WebApi执行异常:[" + context.Request.RequestUri.LocalPath + "]" + message);

            //context.Response = new HttpResponseMessage() { Content = new StringContent(message) };
            base.OnException(context);
        }
        public override void OnActionExecuted(HttpActionExecutedContext actionExecutedContext)
        {
            if (!actionExecutedContext.Request.Properties.ContainsKey(Key))
            {
                return;
            }

            var stopWatch = actionExecutedContext.Request.Properties[Key] as Stopwatch;

            if (stopWatch != null)
            {
                stopWatch.Stop();
                //var actionName = actionExecutedContext.ActionContext.ActionDescriptor.ActionName;
                //var controllerName = actionExecutedContext.ActionContext.ActionDescriptor.ControllerDescriptor.ControllerName;
                WebApiSelfHosting.ShowHostMsg(Color.Green, DateTime.Now, "WebApi执行完成(耗时[" + stopWatch.Elapsed.TotalMilliseconds + "]):[" + actionExecutedContext.Request.RequestUri.LocalPath + "]");
                //Debug.Print(string.Format("[Execution of{0}- {1} took {2}.]", controllerName, actionName, stopWatch.Elapsed));
            }
        }