fix bug (#13792)
parent
9ae9b670b5
commit
f533e51bff
|
@ -47,8 +47,6 @@ namespace ContactManager.Pages.Contacts
|
||||||
|
|
||||||
public async Task<IActionResult> OnPostAsync(int id)
|
public async Task<IActionResult> OnPostAsync(int id)
|
||||||
{
|
{
|
||||||
Contact = await Context.Contact.FindAsync(id);
|
|
||||||
|
|
||||||
var contact = await Context
|
var contact = await Context
|
||||||
.Contact.AsNoTracking()
|
.Contact.AsNoTracking()
|
||||||
.FirstOrDefaultAsync(m => m.ContactId == id);
|
.FirstOrDefaultAsync(m => m.ContactId == id);
|
||||||
|
@ -66,7 +64,7 @@ namespace ContactManager.Pages.Contacts
|
||||||
return new ChallengeResult();
|
return new ChallengeResult();
|
||||||
}
|
}
|
||||||
|
|
||||||
Context.Contact.Remove(Contact);
|
Context.Contact.Remove(contact);
|
||||||
await Context.SaveChangesAsync();
|
await Context.SaveChangesAsync();
|
||||||
|
|
||||||
return RedirectToPage("./Index");
|
return RedirectToPage("./Index");
|
||||||
|
|
Loading…
Reference in New Issue