public async Task <ActionResult> CategoryUpdate(CategoryModel model)
        {
            if (model.Category.ID == 0)
            {
                model.Category.ObjectState = Repository.Pattern.Infrastructure.ObjectState.Added;
                model.Category.Parent      = model.Category.Parent;

                _categoryService.Insert(model.Category);
            }
            else
            {
                var categoryExisting = await _categoryService.FindAsync(model.Category.ID);

                categoryExisting.Parent      = model.Category.Parent;
                categoryExisting.Name        = model.Category.Name;
                categoryExisting.Description = model.Category.Description;
                categoryExisting.Enabled     = model.Category.Enabled;

                categoryExisting.ObjectState = Repository.Pattern.Infrastructure.ObjectState.Modified;

                _categoryService.Update(categoryExisting);
            }

            await _unitOfWorkAsync.SaveChangesAsync();

            // Delete existing category item types
            var ListingTypes = _categoryListingTypeService.Queryable().Where(x => x.CategoryID == model.Category.ID).Select(x => x.ID).ToList();

            foreach (var ListingTypeID in ListingTypes)
            {
                await _categoryListingTypeService.DeleteAsync(ListingTypeID);
            }

            // Insert category item types
            foreach (var categoryListingTypeID in model.CategoryListingTypeID)
            {
                _categoryListingTypeService.Insert(new CategoryListingType()
                {
                    CategoryID    = model.Category.ID,
                    ListingTypeID = categoryListingTypeID,
                    ObjectState   = Repository.Pattern.Infrastructure.ObjectState.Added
                });
            }

            await _unitOfWorkAsync.SaveChangesAsync();

            _dataCacheService.RemoveCachedItem(CacheKeys.ListingTypes);
            _dataCacheService.RemoveCachedItem(CacheKeys.Categories);

            return(RedirectToAction("Categories"));
        }