Exemple #1
0
        public async Task <IActionResult> Create([Bind("Id,SkillName")] Skill skill)
        {
            if (ModelState.IsValid)
            {
                _context.Add(skill);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(skill));
        }
        public async Task <IActionResult> Create([Bind("ProgrammerCode,ProgrammerName,Id,Salary")] Programmer programmer)
        {
            if (ModelState.IsValid)
            {
                _context.Add(programmer);
                await _context.SaveChangesAsync();

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