public IActionResult GetSubcategoriesToXml(int subcategoryId)
        {
            var subcategories       = _subcategoryRepo.Subcategories;
            var getSubcategories    = ViewModelHelper.GetSubcategories(subcategories);
            var selectedSubcategory = getSubcategories.FirstOrDefault(x => x.Id.Equals(subcategoryId));

            if (subcategoryId == 0)
            {
                return(Ok(getSubcategories));
            }
            else
            {
                return(Ok(selectedSubcategory));
            }
        }
        public IActionResult GetSubcategoriesToJsonExport(int subcategoryId)
        {
            var subcategories       = _subcategoryRepo.Subcategories;
            var getSubcategories    = ViewModelHelper.GetSubcategories(subcategories);
            var selectedSubcategory = getSubcategories.FirstOrDefault(x => x.Id.Equals(subcategoryId));

            if (subcategoryId == 0)
            {
                var subcategoryJson = JsonConvert.SerializeObject(getSubcategories);
                var bytes           = Encoding.UTF8.GetBytes(subcategoryJson);
                return(File(bytes, "application/octet-stream", "subcategories.json"));
            }
            else
            {
                var selectedSubcategoryJson = JsonConvert.SerializeObject(selectedSubcategory);
                var bytes = Encoding.UTF8.GetBytes(selectedSubcategoryJson);
                return(File(bytes, "application/octet-stream", "subcategory_" + subcategoryId + ".json"));
            }
        }