public async Task <IActionResult> Get(string id) { if (string.IsNullOrWhiteSpace(id)) { throw new ArgumentNullException(nameof(id)); } var result = await _endpointRepository.Get(id); if (result == null) { return(new NotFoundResult()); } return(new OkObjectResult(ToJson(result))); }
private static void Monitor_EndpointChecked(EndpointCheckedEventArgs args) { var newStatus = new EndpointStatus() { Timestamp = args.Timestamp, StatusCode = args.StatusCode }; var endpoint = endpointRepo.Get(args.Url); if (StatusShouldBeReported(endpoint.LastStatus, newStatus)) { ReportStatus(endpoint, newStatus); } endpoint.Statuses.Add(newStatus); endpointRepo.SaveChanges(); }