Beispiel #1
0
        public IHttpActionResult GetProductCategory(int productid)
        {
            try
            {
                List <ProductCategory> produtCategory = produtDetail.GetProductCategory(productid);

                if (produtCategory.Count > 0)
                {
                    status.code    = 200;
                    status.message = "success";
                    return(ResponseMessage(Request.CreateResponse(HttpStatusCode.OK, new { status = status, result = produtCategory })));
                }
                else
                {
                    status.code    = 201;
                    status.message = "Product Category Not Available?";
                    return(ResponseMessage(Request.CreateResponse(HttpStatusCode.NotFound, new { status = status })));
                }
            }
            catch (Exception ex)
            {
                status.code    = 500;
                status.message = ex.Message.ToString();
                return(ResponseMessage(Request.CreateResponse(HttpStatusCode.InternalServerError, new { status = status })));
            }
        }