public async Task <IActionResult> OnPostAsync(string userid, int?courseid) { if (userid == null || courseid == null) { return(NotFound()); } UserCourse = _reader.Get <UserCourse>(userid, (int)courseid); if (UserCourse != null) { await _writer.Remove <UserCourse>(UserCourse); } return(RedirectToPage("./Index")); }
public async Task <IActionResult> OnPostAsync() { if (!ModelState.IsValid) { return(Page()); } try { await _writer.Remove <ItemType>(ItemType); } catch { } return(RedirectToPage("./Index")); }