public async Task <IActionResult> Get() { try { return(Ok(await service.Get())); } catch (Exception ex) { return(NotFound(ex)); } }
public IActionResult Get() { try { return(Ok(service.Get())); } catch (Exception) { return(NotFound()); } }
public void Get_WhenGetElementByKnownId_ThenReturnedNotNullObject() { // Arrange // Act var returnedCount = service.Get(testItem.Id); // Assert Assert.IsNotNull(returnedCount); }
public IActionResult Get(Guid id) { PilotDto pilotDto; try { pilotDto = pilotService.Get(id); } catch (Exception ex) { return(BadRequest(new { ErrorType = ex.GetType().Name, ex.Message })); } return(Ok(pilotDto)); }
public async Task <IActionResult> GetById(int id) { return(Json(await _service.Get(id))); }
public IEnumerable <Pilot> Get() { return(service.Get()); }
public async Task <IActionResult> GetAll() { return(Ok(await service.Get())); }