public async Task <Product> UpdateProductAsync(Product Product)
 {
     using (var context = new DataContextProducts())
     {
         context.Entry(Product).State = EntityState.Modified;
         await context.SaveChangesAsync();
     }
     return(Product);
 }
        public async Task DeleteProductAsync(int id)
        {
            using (var context = new DataContextProducts())
            {
                var Product = await context.Products.FirstOrDefaultAsync(f => f.ProductId == id);

                context.Entry(Product).State = EntityState.Deleted;
                await context.SaveChangesAsync();
            }
        }
        public async Task <Product> AddProductAsync(Product Product)
        {
            Product result;

            using (var context = new DataContextProducts())
            {
                result = context.Products.Add(Product);//нужно ли делать операцию ассинхронно?
                await context.SaveChangesAsync();
            }
            return(result);
        }