public async Task Create(UserPortal userPortal)
        {
            userPortal.CreationDate = DateTime.Now;
            await _context.UsersPortal.AddAsync(userPortal);

            await _context.SaveChangesAsync();
        }
Пример #2
0
        public async Task Create(Order order)
        {
            await _context.AddAsync(order);

            foreach (var item in order.ProductOrderList)
            {
                item.OrderId = order.Id;
                await _context.ProductOrders.AddAsync(item);
            }

            await _context.SaveChangesAsync();
        }
 public async Task Create(Product product)
 {
     product.CreationDate = DateTime.Now;
     _context.Add(product);
     await _context.SaveChangesAsync();
 }