public async Task <IActionResult> OnPostAsync() { var currentUserId = _userManager.GetUserId(HttpContext.User); if (!ModelState.IsValid) { return(Page()); } _context.Attach(ApplyForJob).State = EntityState.Modified; try { ViewData["EditMessage"] = "Has updated Successfully"; await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!ApplyForJobExists(ApplyForJob.Id)) { return(NotFound()); } else { throw; } } return(Page()); }
public async Task <IActionResult> OnPostAsync() { if (!ModelState.IsValid) { return(Page()); } _context.Attach(Category).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!CategoryExists(Category.Id)) { return(NotFound()); } else { throw; } } return(RedirectToPage("./Index")); }