Esempio n. 1
0
        public async Task <IActionResult> Create([Bind("ProtocolCode,Description")] Protocol protocol)
        {
            if (ModelState.IsValid)
            {
                _context.Add(protocol);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(protocol));
        }
Esempio n. 2
0
        public async Task <IActionResult> Create([Bind("EnvironmentCode,Description")] Context.Environment environment)
        {
            if (ModelState.IsValid)
            {
                _context.Add(environment);
                await _context.SaveChangesAsync();

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