public int Post([FromBody] CategoryModel model)
        {
            if (model == null)
            {
                return(0);
            }
            var category = _mapper.Map <CategoryModel, Category>(model);

            _context.Categories.Add(category);
            _context.SaveChanges();
            return(category.Id);
        }
        public int Put([FromBody] ProductSaveModel model)
        {
            if (model == null)
            {
                return(0);
            }
            var productEntry = _context.Products.Find(model.Id);

            if (productEntry == null)
            {
                return(0);
            }
            productEntry.ProductName = model.ProductName;
            productEntry.CategoryId  = model.CategoryId;
            _context.Products.Update(productEntry);
            _context.SaveChanges();
            return(productEntry.Id);
        }