Esempio n. 1
0
        public async Task <PagedResultOutput <AuditLogListDto> > GetAuditLogs(GetAuditLogsInput input)
        {
            IQueryable <AuditLogAndUser> auditLogAndUsers = this.CreateAuditLogAndUsersQuery(input);
            int num = await auditLogAndUsers.CountAsync <AuditLogAndUser>();

            List <AuditLogAndUser> listAsync = await auditLogAndUsers.AsNoTracking <AuditLogAndUser>().OrderBy <AuditLogAndUser>(input.Sorting, new object[0]).PageBy <AuditLogAndUser>(input).ToListAsync <AuditLogAndUser>();

            return(new PagedResultOutput <AuditLogListDto>(num, AuditLogAppService.ConvertToAuditLogListDtos(listAsync)));
        }
Esempio n. 2
0
 private static List <AuditLogListDto> ConvertToAuditLogListDtos(List <AuditLogAndUser> results)
 {
     return(results.Select <AuditLogAndUser, AuditLogListDto>((AuditLogAndUser result) => {
         AuditLogListDto auditLogListDto = result.AuditLog.MapTo <AuditLogListDto>();
         auditLogListDto.UserName = (result.User == null ? null : result.User.UserName);
         auditLogListDto.ServiceName = AuditLogAppService.StripNameSpace(auditLogListDto.ServiceName);
         return auditLogListDto;
     }).ToList <AuditLogListDto>());
 }
Esempio n. 3
0
        public async Task <FileDto> GetAuditLogsToExcel(GetAuditLogsInput input)
        {
            IQueryable <AuditLogAndUser> auditLogAndUsers = this.CreateAuditLogAndUsersQuery(input).AsNoTracking <AuditLogAndUser>();
            List <AuditLogAndUser>       listAsync        = await(
                from al in auditLogAndUsers
                orderby al.AuditLog.ExecutionTime descending
                select al).ToListAsync <AuditLogAndUser>();
            List <AuditLogListDto> auditLogListDtos = AuditLogAppService.ConvertToAuditLogListDtos(listAsync);

            return(this._auditLogListExcelExporter.ExportToFile(auditLogListDtos));
        }