コード例 #1
0
        public async Task <IActionResult> Create([Bind("ID,Name")] SquasherModel squasherModel)
        {
            if (ModelState.IsValid)
            {
                _context.Add(squasherModel);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(squasherModel));
        }
コード例 #2
0
        public async Task <IActionResult> Create([Bind("ID,Title,Description,Severity,Version,TrackDate")] BugModel bugModel)
        {
            if (ModelState.IsValid)
            {
                _context.Add(bugModel);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(bugModel));
        }
コード例 #3
0
        public async Task <IActionResult> Create([Bind("ID,Title")] ProjectModel projectModel)
        {
            if (ModelState.IsValid)
            {
                _context.Add(projectModel);
                await _context.SaveChangesAsync();

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