コード例 #1
0
        public void Intercept(IInvocation invocation)
        {
            var watch = new Stopwatch();

            watch.Start();
            invocation.Proceed();
            watch.Stop();
            var newEventLog = new Entities.EventLog
            {
                EventCallerName = invocation.Request.Method.Name,
                EventDate       = DateTime.Now,
                EventDuration   = watch.ElapsedMilliseconds.ToString(),
                Description     = invocation.Request.Method.ToString()
            };

            _eventLogService.Add(newEventLog);
        }
コード例 #2
0
        public ActionResult Create(EventLog eventLog)
        {
            var result = _eventLogService.Add(eventLog);

            return(View(result));
        }