public async Task DeleteProductAsync(Product product) { using (var db = new WPFSampleDb()) { db.Products.Remove(product); await db.SaveChangesAsync(); } }
public async Task AddProductAsync(Product product) { using (var db = new WPFSampleDb()) { await db.Products.AddAsync(product); await db.SaveChangesAsync(); } }