private Result BuildOutput(AnimalResul animal)
 {
     if (animal != null)
     {
         return(new Result
         {
             Data = animal,
             Error = 0,
             Mes = ""
         });
     }
     else
     {
         return(new Result
         {
             Data = null,
             Error = 404,
             Mes = "Animal not found"
         });
     }
 }
 private Result BuildOutput(AnimalResul animal)
 {
     if (animal != null)
     {
         return(new Result
         {
             Data = animal,
             Error = 0,
             Mes = ""
         });
     }
     else
     {
         return(new Result
         {
             Data = null,
             Error = 500,
             Mes = "Error en el proceso"
         });
     }
 }
Example #3
0
        public async Task <IActionResult> Put(int id, [FromBody] AnimalResul value)
        {
            var resul = _updateAnimalUseCase.Execute(new UpdateAnimalInput(id, value.Name, value.Ege, value.NumberLegs));

            return(Ok(resul));
        }
Example #4
0
        public async Task <IActionResult> Post([FromBody] AnimalResul value)
        {
            var resul = await _createAnimalUseCase.Execute(new CreateAnimalInput(value.Name, value.Ege, value.NumberLegs));

            return(Ok(resul));
        }