// GET: Admin/SubCategories/Edit/5
        public async Task <IActionResult> Edit(int?id)
        {
            if (id == null)
            {
                return(NotFound());
            }

            var subCategory = await _repository.Get(id.Value);

            if (subCategory == null)
            {
                return(NotFound());
            }
            ViewData["CategoryId"] = new SelectList(_repository.GetCategories(), "Id", "Title", subCategory.CategoryId);
            return(View(subCategory));
        }