public async Task <IActionResult> Create([Bind("DestinationsID,Country,Name,Climate")] Destinations destinations)
        {
            if (ModelState.IsValid)
            {
                _context.Add(destinations);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(destinations));
        }
Пример #2
0
        public async Task <IActionResult> Create([Bind("SuppliesID,Name,Qty")] Supplies supplies)
        {
            if (ModelState.IsValid)
            {
                _context.Add(supplies);
                await _context.SaveChangesAsync();

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