public ActionResult Create(DataPlayer.Entity.Categories category)
        {
            if (ModelState.IsValid)
            {
                var newCategoryId = _categoriesRepo.Add(category);


                var newAddedCategory = new Category()
                {
                    CategoryId          = newCategoryId.ToString(),
                    CategoryName        = category.CategoryName,
                    CategoryDescription = category.Description,
                    //CategoryPicture = $"data:image/png;base64,{Convert.ToBase64String(cate.Picture)}"
                };
                return(newCategoryId > 0
                    ? Json(new { success = true, message = "ok", data = newAddedCategory }, JsonRequestBehavior.AllowGet)
                    : Json(new { success = false, message = "nok" }, JsonRequestBehavior.AllowGet));
            }

            //return View(category);
            return(null);
        }
        public ActionResult GetAllCategories()
        {
            var lstCategories = _categoriesRepo.GetData().ToList();

            var listCategoryModels = new List <Category>();

            foreach (var cate in lstCategories)
            {
                var newCategory = new Category()
                {
                    CategoryId          = cate.CategoryId.ToString(),
                    CategoryName        = cate.CategoryName,
                    CategoryDescription = cate.Description,
                    //CategoryPicture = $"data:image/png;base64,{Convert.ToBase64String(cate.Picture)}"
                };
                listCategoryModels.Add(newCategory);
            }

            return(lstCategories.Count > 0
                ? Json(new { success = true, message = "ok", data = listCategoryModels }, JsonRequestBehavior.AllowGet)
                : Json(new { success = false, message = "nok" }, JsonRequestBehavior.AllowGet));
        }