public IHttpActionResult EditCategoryById(int id, CategoryBindingModel categoryBindingModel)
        {
            var category = this.Data.Categories.Find(id);

            if (category == null)
            {
                return this.NotFound();
            }

            if (!ModelState.IsValid)
            {
                return this.BadRequest("Invalid category binding model");
            }

            category.Name = categoryBindingModel.Name;

            this.Data.Categories.Update(category);
            this.Data.SaveChanges();

            return this.Ok("Category edited");
        }
        public IHttpActionResult AddCategory(CategoryBindingModel categoryModel)
        {
            if (!ModelState.IsValid)
            {
                return this.BadRequest("Invalid category binding model");
            }

            var category = new Category
            {
                Name = categoryModel.Name
            };

            if (Data.Categories.All().FirstOrDefault(c => c.Name == category.Name) != null)
            {
                return BadRequest(string.Format("Category {0} allready exists in the db", category.Name));
            }

            this.Data.Categories.Add(category);
            this.Data.SaveChanges();

            return this.Ok(string.Format("Category {0} added", category.Name));
        }