public AllResponse <Category> All()
        {
            try
            {
                var response = new AllResponse <Category>();
                response.Result = categoryBussiness.All();
                return(response);
            }
            catch (Exception ex)
            {
                var httpError = new HttpResponseMessage()
                {
                    StatusCode   = (HttpStatusCode)422,
                    ReasonPhrase = ex.Message
                };

                throw new HttpResponseException(httpError);
            }
        }
예제 #2
0
        public CategoryAllResponse All()
        {
            try
            {
                var response = new CategoryAllResponse();
                var bc       = new CategoryBusiness();
                response.Result = bc.All();
                return(response);
            }
            catch (Exception ex)
            {
                var httpError = new HttpResponseMessage
                {
                    StatusCode   = (HttpStatusCode)422,
                    ReasonPhrase = ex.Message
                };

                throw new HttpResponseException(httpError);
            }
        }