Exemple #1
0
        public async Task AddProductAsync(Product product, List <ProductProperty> chars)
        {
            await context.Product.AddAsync(product);

            await context.SaveChangesAsync();

            chars.ForEach(item => item.ProductId = product.Id);
            await context.AddRangeAsync(chars);

            await context.SaveChangesAsync();
        }