public IQueryable<Product> UpdateProduct(Product update) { this.products.Update(update); this.products.SaveChanges(); return this.products.All().Where(x => x.Id == update.Id); }
public async Task<Product> AddProduct(Product toAdd) { this.products.Add(toAdd); await this.products.SaveChangesAsync(); return toAdd; }