Exemplo n.º 1
0
 public async Task <IActionResult> Get()
 {
     try
     {
         return(Ok(await service.Get()));
     }
     catch (Exception ex)
     {
         return(NotFound(ex));
     }
 }
Exemplo n.º 2
0
 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);
        }
Exemplo n.º 4
0
        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));
        }
Exemplo n.º 5
0
 public async Task <IActionResult> GetById(int id)
 {
     return(Json(await _service.Get(id)));
 }
Exemplo n.º 6
0
 public IEnumerable <Pilot> Get()
 {
     return(service.Get());
 }
 public async Task <IActionResult> GetAll()
 {
     return(Ok(await service.Get()));
 }