public async Task <IActionResult> Get() { IEnumerable <ShellTemp> allDataReadings = await _shellTempRepository.GetAll(); ShellTemp[] dataReadings = allDataReadings as ShellTemp[] ?? allDataReadings.ToArray(); dataReadings = dataReadings.OrderBy(date => date.RecordedDateTime).ToArray(); if (dataReadings.Length == 0) { return(BadRequest("No data could be found")); } return(Ok(dataReadings)); }
public async Task <IEnumerable <ShellTemp> > GetAll() { IEnumerable <ShellTemp> shellTemps = _shellTemperatureRepository.GetAll(); return(await Task.FromResult(shellTemps)); }