Example #1
0
        public async Task <IActionResult> Run([HttpTrigger(AuthorizationLevel.Function, "get", Route = null)] HttpRequest req, ILogger log)
        {
            var facilityId = req.Query["facilityId"].ToString();

            if (string.IsNullOrEmpty(facilityId))
            {
                return(new BadRequestResult());
            }

            var audits = _auditRepository.Find(x => x.FacilityId == facilityId).ToList();

            return(new OkObjectResult(audits.Select(x => new AuditPreviewDto
            {
                Id = x.RowKey,
                FacilityId = x.FacilityId,
                StartTimeUtc = x.StartTimeUtc,
                FinishTimeUtc = x.FinishTimeUtc
            })));
        }
Example #2
0
 public IEnumerable <Audit> GetAudits()
 {
     return(_auditRepository.Find(null));
 }
Example #3
0
 public async Task <IList <Audit> > FindAudits(Guid correlationId)
 {
     return(await _auditRepository.Find(correlationId));
 }