Exemplo n.º 1
0
        public async Task <IActionResult> Create([Bind("Id,Name")] Phone phone)
        {
            if (ModelState.IsValid)
            {
                _context.Add(phone);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(phone));
        }
Exemplo n.º 2
0
        public async Task <IActionResult> Create([Bind("ID,EMAIL,ID_Department")] Config config)
        {
            if (ModelState.IsValid)
            {
                _context.Add(config);
                await _context.SaveChangesAsync();

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

            return(View(config));
        }