Closed Rick-Anderson closed 7 years ago
Expected behavior: Scaffolder should correctly handle DbUpdateConcurrencyException
DbUpdateConcurrencyException
Actual behavior: DbUpdateConcurrencyException is caught and ignored.
To repro:
The Edit.cshtml.cs file contains the following code:
public async Task<IActionResult> OnPostAsync() { if (!ModelState.IsValid) { return Page(); } _context.Attach(Movie).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { } return RedirectToPage("./Index"); }
It should be
catch (DbUpdateConcurrencyException) { if (!MovieExists(movie.ID)) { return NotFound(); } else { throw; } }
Expected behavior: Scaffolder should correctly handle
DbUpdateConcurrencyException
Actual behavior:
DbUpdateConcurrencyException
is caught and ignored.To repro:
The Edit.cshtml.cs file contains the following code:
It should be