示例#1
0
        public async Task <IActionResult> Create([Bind("Id,EmailAddress")] Owner owner)
        {
            if (ModelState.IsValid)
            {
                _context.Add(owner);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(owner));
        }
示例#2
0
        public async Task <IActionResult> Create([Bind("Id,OwnerId,RowLabel,ColLabel,ColNumbers,RowNumbers")] Board board)
        {
            if (ModelState.IsValid)
            {
                _context.Add(board);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["OwnerId"] = new SelectList(_context.Owners, "Id", "Id", board.OwnerId);
            return(View(board));
        }