예제 #1
0
        public async Task <IActionResult> Create([Bind("Id,WebsiteName,Description,Rank,Country")] Website website)
        {
            if (ModelState.IsValid)
            {
                _context.Add(website);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(website));
        }
        public async Task <IActionResult> Create([Bind("Id,CryptoName,Type,Price,Country")] Crypto crypto)
        {
            if (ModelState.IsValid)
            {
                _context.Add(crypto);
                await _context.SaveChangesAsync();

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