public async Task <IActionResult> Edit(int id, [Bind("UserId,UserName,Email,LastName,FirstName,UserAccountId")] Users users)
 {
     if (id != users.UserId)
     {
         return(NotFound());
     }
     if (ModelState.IsValid)
     {
         try
         {
             _context.Update(users);
             await _context.SaveChangesAsync();
         }
         catch (DbUpdateConcurrencyException)
         {
             if (!UsersExists(users.UserId))
             {
                 return(NotFound());
             }
             else
             {
                 throw;
             }
         }
         return(RedirectToAction(nameof(Index)));
     }
     return(View(users));
 }
Esempio n. 2
0
 public IActionResult Update([Bind("BlogTitle,BlogPost,BlogDate,BlogId")] Blog blog)
 {
     if (ModelState.IsValid)
     {
         _context.Update(blog);
         _context.SaveChanges();
         return(RedirectToAction(nameof(List)));
     }
     return(View(blog));
 }