public ActionResult Categories_Update([DataSourceRequest]DataSourceRequest request, CategoryInputModel category)
        {
            if (this.ModelState.IsValid)
            {
                var entity = this.categories.GetById(category.Id);

                entity.Name = category.Name;

                this.categories.Save();
            }

            var categoryToDisplay = this.categories
               .GetAll()
               .To<CategoryViewModel>()
               .FirstOrDefault(x => x.Id == category.Id);

            return this.Json(new[] { categoryToDisplay }.ToDataSourceResult(request, this.ModelState));
        }
        public ActionResult Categories_Create([DataSourceRequest]DataSourceRequest request, CategoryInputModel category)
        {
            var newId = 0;
            if (this.ModelState.IsValid)
            {
                var entity = new Category
                {
                    Name = category.Name
                };

                this.categories.Add(entity);
                newId = entity.Id;
            }

            var categoryToDisplay = this.categories
                .GetAll()
                .To<CategoryViewModel>()
                .FirstOrDefault(x => x.Id == newId);

            return this.Json(new[] { categoryToDisplay }.ToDataSourceResult(request, this.ModelState));
        }