public async Task <IEnumerable <ExceptionLogModel> > GetExceptionLogAsync(ExceptionLogAdminSearchModel model) { return(await Context.ExceptionLog .OrderByDescending(x => x.Id) .Select(x => new ExceptionLogModel { ErrorCode = x.ErrorCode, ErrorMessage = x.ErrorMessage, ErrorType = x.ErrorType, EventDate = x.EventDate, StackTrace = x.StackTrace }).ToListAsync()); }
public async Task <ExceptionLogListModel> MakeListModel(ExceptionLogAdminSearchModel searchModel) { var exceptionLogs = await _exceptionLogAdminHandler.SearchExceptionLog(searchModel); var exceptionLogItems = exceptionLogs.Select(x => new ExceptionLogListItemModel { ErrorCode = x.ErrorCode, ErrorMessage = x.ErrorMessage, ErrorType = x.ErrorType, EventDate = x.EventDate, StackTrace = x.StackTrace }); var exceptionLogItemsPagedList = new PagedList <ExceptionLogListItemModel>( exceptionLogItems, exceptionLogs.PageIndex, exceptionLogs.PageSize, exceptionLogs.TotalCount ); return(new ExceptionLogListModel().PrepareToGrid(searchModel, exceptionLogs, () => exceptionLogItemsPagedList)); }
public async Task <IEnumerable <ExceptionLogModel> > FetchExceptionLogAsync(ExceptionLogAdminSearchModel model) { return(await _unitOfWorkManager.ExecuteSingleAsync <IExceptionLogRepository, IEnumerable <ExceptionLogModel> > (u => u.GetExceptionLogAsync(model))); }
public async Task <JsonResult> SearchExceptionLogs(ExceptionLogAdminSearchModel searchModel) { var model = await _exceptionLogFactory.MakeListModel(searchModel); return(Json(model)); }