public ActionResult GetItemsByCategory(int categoryId) { var result = _service.GetForCategory(categoryId); if (!result.Success) { return(new HttpStatusCodeResult(400, result.ErrorMessage)); } return(Json(result.ListItems, JsonRequestBehavior.AllowGet)); }