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

                await db.SaveChangesAsync();
            }
        }