コード例 #1
0
ファイル: DealerService.cs プロジェクト: MagninM/MCGA2017
        public FindDealerResponse Find(int id)
        {
            try
            {
                var response = new FindDealerResponse();
                var dc       = new DealerBusiness();
                response.Result = dc.Find(id);
                return(response);
            }
            catch (Exception ex)
            {
                var httpError = new HttpResponseMessage()
                {
                    StatusCode   = (HttpStatusCode)422,
                    ReasonPhrase = ex.Message
                };

                throw new HttpResponseException(httpError);
            }
        }
コード例 #2
0
        public FindResponse <Dealer> Find(int id)
        {
            logger.Info($"Inicio de la busqueda de la categoria con id {id}");
            try
            {
                var response = new FindResponse <Dealer>();
                response.Result = dealerBusiness.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);
            }
        }