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" }); } }
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)); }
public async Task <IActionResult> Post([FromBody] AnimalResul value) { var resul = await _createAnimalUseCase.Execute(new CreateAnimalInput(value.Name, value.Ege, value.NumberLegs)); return(Ok(resul)); }