public ActionResult <InteresadoViewModel> Get(int id) { var interesado = interesadoService.Consultar(id); if (interesado == null) { return(NotFound()); } var interesadoViewModel = new InteresadoViewModel(interesado); return(interesadoViewModel); }
public ActionResult <InteresadoViewModel> getByNit(string id) { var response = interesadoService.ConsultarId(id); if (response.Error) { ModelState.AddModelError("Error al consultar usuario interesado", response.Mensaje); var detallesProblema = new ValidationProblemDetails(ModelState) { Status = StatusCodes.Status400BadRequest }; return(BadRequest(detallesProblema)); } InteresadoViewModel interesadoViewModel = new InteresadoViewModel(response.Interesado); return(Ok(interesadoViewModel)); }