public async Task <IActionResult> AllAuditLogs() { try { var response = _repository.Find(null, x => x.IsDeleted == false); AuditLogsLookupViewModel auditLogsList = new AuditLogsLookupViewModel(); if (response != null) { auditLogsList.ServiceNameList = new List <string>(); foreach (AuditLog item in response.Items) { string serviceName = item.ServiceName; string name = _repository.GetServiceName(item); if (!auditLogsList.ServiceNameList.Contains(name)) { auditLogsList.ServiceNameList.Add(name); } } } return(Ok(auditLogsList)); } catch (Exception ex) { return(ex.GetActionResult()); } }
public AuditLogsLookupViewModel AllAuditLogs() { var response = repository.Find(null, x => x.IsDeleted == false); AuditLogsLookupViewModel auditLogsList = new AuditLogsLookupViewModel(); if (response != null) { auditLogsList.ServiceNameList = new List <string>(); foreach (AuditLog item in response.Items) { string serviceName = item.ServiceName; string name = repository.GetServiceName(item); if (!auditLogsList.ServiceNameList.Contains(name)) { auditLogsList.ServiceNameList.Add(name); } } } return(auditLogsList); }