public async Task Put(int Id, Product model) { var product = Db.Product.Find(Id); product.Brand = model.Brand; product.Price = model.Price; product.Name = model.Name; product.Description = model.Description; await Db.SaveChangesAsync(); }
public async Task Post(Product model) { var product = new Product { Brand = model.Brand, Price = model.Price, Name = model.Name, Description = model.Description, }; Db.Product.Add(product); await Db.SaveChangesAsync(); }