public FindRatingResponse Find(int id) { try { var response = new FindRatingResponse(); var br = new RatingBusiness(); response.Result = br.Find(id); return(response); } catch (Exception ex) { var httpError = new HttpResponseMessage() { StatusCode = (HttpStatusCode)422, ReasonPhrase = ex.Message }; throw new HttpResponseException(httpError); } }
public FindResponse <Rating> Find(int id) { logger.Info($"Inicio de la busqueda de la categoria con id {id}"); try { var response = new FindResponse <Rating>(); response.Result = ratingBusiness.Find(id); return(response); } catch (Exception ex) { logger.Error($"Error al obtener la categoria {id}", ex); var httpError = new HttpResponseMessage() { StatusCode = (HttpStatusCode)422, ReasonPhrase = ex.Message }; throw new HttpResponseException(httpError); } }