public async Task <IActionResult> EventLog(int current = 0) { var hasPermission = await _accessManager.HasPermission(User.Identity.Name, _adminSubsystemName); if (hasPermission) { var pathToLogs = Path.Combine(_hostEnvironment.ContentRootPath, "Logs"); var dates = _eventLogService.GetAllLogDates(pathToLogs); dates.Sort((time1, time2) => - time1.CompareTo(time2)); var logs = _eventLogService.GetLogs(pathToLogs, dates[current]); var model = new EventLogViewModel() { CurrentDate = current, Dates = dates, Logs = logs }; return(View(model)); } return(Forbid(CookieAuthenticationDefaults.AuthenticationScheme)); }