Exemplo n.º 1
0
        public async Task <IActionResult> Create([Bind("ID,login,password")] User user)
        {
            if (ModelState.IsValid)
            {
                _context.Add(user);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(user));
        }
Exemplo n.º 2
0
        public async Task <IActionResult> Create([Bind("ID,code,value")] Currency currency)
        {
            if (ModelState.IsValid)
            {
                _context.Add(currency);
                await _context.SaveChangesAsync();

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