public async Task <IActionResult> Create(SubCategory subCategory)
        {
            if (ModelState.IsValid)
            {
                subCategory.Created_at = DateTime.Now;
                subCategory.Updated_at = DateTime.Now;
                if (TempData["UploadedImage"] != null)
                {
                    subCategory.ImageName = TempData["UploadedImage"].ToString();
                }

                await _repository.Add(subCategory);

                TempData["UploadedImage"] = null;
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["CategoryId"] = new SelectList(_repository.GetCategories(), "Id", "Title", subCategory.CategoryId);
            return(View(subCategory));
        }