Exemplo n.º 1
0
		public async Task<ActionResult> Index()
		{
			var logs = (await LogService.GetLastMonthLogsAsync()).OrderByDescending(l => l.UtcDate).AsEnumerable();
			var model = new LogViewModel(_defaultLevel, DateTime.Now.AddMonths(-1), logs);

			return View(model);
		}
Exemplo n.º 2
0
		public async Task<ActionResult> ByLevelAndDate(DateTime startDate, DateTime endDate, LogLevel logLevel = _defaultLevel)
		{
			var logs = (await LogService.GetByDateAndLevelAsync(startDate.ToUniversalTime(), endDate.ToUniversalTime(), logLevel))
						.OrderByDescending(l => l.UtcDate)
						.AsEnumerable();

			var model = new LogViewModel(logLevel, startDate, endDate, logs);

			return View("Index", model);
		}