File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
aspnetcore/data/ef-rp/intro/samples/cu90/Pages/Students Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change 1- using System ;
1+ using System ;
22using System . Collections . Generic ;
33using System . Linq ;
44using System . Threading . Tasks ;
@@ -56,7 +56,7 @@ public async Task<IActionResult> OnPostAsync()
5656 }
5757 catch ( DbUpdateConcurrencyException )
5858 {
59- if ( ! StudentExists ( Student . ID ) )
59+ if ( ! await StudentExistsAsync ( Student . ID ) )
6060 {
6161 return NotFound ( ) ;
6262 }
@@ -69,9 +69,9 @@ public async Task<IActionResult> OnPostAsync()
6969 return RedirectToPage ( "./Index" ) ;
7070 }
7171
72- private bool StudentExists ( int id )
72+ private Task < bool > StudentExistsAsync ( int id )
7373 {
74- return _context . Students . Any ( e => e . ID == id ) ;
74+ return _context . Students . AnyAsync ( e => e . ID == id ) ;
7575 }
7676 }
7777}
You can’t perform that action at this time.
0 commit comments