Пример #1
0
        public async Task <IActionResult> _CreateNew(Order order)
        {
            _context.Add(order);
            await _context.SaveChangesAsync();

            return(RedirectToAction("Index"));
        }
Пример #2
0
        public async Task <IActionResult> Create([Bind("ID,Email,Description,TotalPrice")] Order order)
        {
            if (ModelState.IsValid)
            {
                _context.Add(order);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(order));
        }