// POST: api/Categories
        public IHttpActionResult PostCategory(CategoryBindingModel categoryModel)
        {
            if (categoryModel == null)
            {
                this.ModelState.AddModelError("categoryModel", "Category model can not be empty!");
            }

            if (!ModelState.IsValid)
            {
                return BadRequest(ModelState);
            }

            var checkExistCategory = db.Categories.FirstOrDefault(c => c.Name == categoryModel.Name);
            if(checkExistCategory != null)
            {
                return this.BadRequest("Category exists");
            }

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

            db.Categories.Add(category);
            db.SaveChanges();

            return this.Ok("Category successfully added");
        }
        public IHttpActionResult PutCategory(int id, CategoryBindingModel chandegCategory)
        {
            var dbCategory = db.Categories.FirstOrDefault(c => c.Id == id);
            if(dbCategory == null)
            {
                return this.NotFound();
            }

            if(chandegCategory.Name == String.Empty)
            {
                return this.BadRequest("Category name can not be empty");
            }

            var checkDuplicateCategory = db.Categories.FirstOrDefault(c => c.Name == chandegCategory.Name);
            if(checkDuplicateCategory != null)
            {
                return this.BadRequest("Category exists");
            }

            dbCategory.Name = chandegCategory.Name;
            db.SaveChanges();

            return this.Ok("Category changed succesfully");
        }