Пример #1
0
        /// <summary>
        /// 2、result执行后发生
        /// </summary>
        /// <param name="context"></param>
        public override void OnResultExecuted(ResultExecutedContext context)
        {
            if (_isIgnore)
            {
                return;
            }

            if (context.Result is ObjectResult)
            {
                _logModel.ResponseParam = JsonConvert.SerializeObject(((ObjectResult)context.Result).Value);
            }

            _timer.Stop();
            _logModel.DurationTimeOfMillisecond = _timer.ElapsedMilliseconds.ToString().ToInt32();
            _log.AuditAsync(_logModel);
        }