public IHttpActionResult Get(string id) { var entity = service.Get(id); if (entity == null) { return(NotFound()); } return(Ok(entity)); }
public HttpResponseMessage Obtener() { var resultado = (HttpResponseMessage)null; try { resultado = Request.CreateResponse(HttpStatusCode.OK, _estadoService.Get()); } catch (Exception exception) { resultado = Request.CreateResponse(HttpStatusCode.InternalServerError, new { message = exception.Message }); } return(resultado); }