コード例 #1
0
        public async Task <IActionResult> Create([Bind("ProjectID,Title,Description")] Project project)
        {
            if (ModelState.IsValid)
            {
                _context.Add(project);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(project));
        }
コード例 #2
0
        public async Task <IActionResult> Create([Bind("CoderID,Name,CoderInfo")] Coder coder)
        {
            if (ModelState.IsValid)
            {
                _context.Add(coder);
                await _context.SaveChangesAsync();

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