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

                return(RedirectToAction(nameof(Index)));
            }
            return(View(gender));
        }
 public Task Save()
 {
     return(_appDbContext.SaveChangesAsync());
 }