// To protect from overposting attacks, enable the specific properties you want to bind to, for // more details, see https://aka.ms/RazorPagesCRUD. public async Task <IActionResult> OnPostAsync() { if (!ModelState.IsValid) { return(Page()); } _context.Attach(Character).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!CharacterExists(Character.CharacterID)) { return(NotFound()); } else { throw; } } return(RedirectToPage("./Index")); }
// To protect from overposting attacks, enable the specific properties you want to bind to, for // more details, see https://aka.ms/RazorPagesCRUD. public async Task <IActionResult> OnPostAsync() { if (!ModelState.IsValid || !CheckAniVaild() || !CheckPersonValid() || !CheckRepeat()) { return(Page()); } _context.Attach(AnimePerson).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!AnimePersonExists(AnimePerson.AnimePersonID)) { return(NotFound()); } else { throw; } } return(RedirectToPage("./Index")); }
// To protect from overposting attacks, enable the specific properties you want to bind to, for // more details, see https://aka.ms/RazorPagesCRUD. public async Task <IActionResult> OnPostAsync() { if (!ModelState.IsValid || !CheckAniVaild() || !CheckRepeat() || !CheckTagValid()) { return(Page()); } _context.AnimeTagA.Add(AnimeTagA); await _context.SaveChangesAsync(); return(RedirectToPage("./Index")); }
// To protect from overposting attacks, enable the specific properties you want to bind to, for // more details, see https://aka.ms/RazorPagesCRUD. public async Task <IActionResult> OnPostAsync() { if (!ModelState.IsValid || !CheckPerVaild() || !CheckRepeat() || !CheckChaValid()) { return(Page()); } _context.PersonCharacter.Add(PersonCharacter); await _context.SaveChangesAsync(); return(RedirectToPage("./Index")); }
// To protect from overposting attacks, enable the specific properties you want to bind to, for // more details, see https://aka.ms/RazorPagesCRUD. public async Task <IActionResult> OnPostAsync() { if (!ModelState.IsValid) { return(Page()); } _context.Anime.Add(Anime); await _context.SaveChangesAsync(); return(RedirectToPage("./Index")); }
public async Task <IActionResult> OnPostAsync(int?id) { if (id == null) { return(NotFound()); } AnimeCharacter = await _context.AnimeCharacter.FindAsync(id); if (AnimeCharacter != null) { _context.AnimeCharacter.Remove(AnimeCharacter); await _context.SaveChangesAsync(); } return(RedirectToPage("./Index")); }
public async Task <IActionResult> OnPostAsync(int?id) { if (id == null) { return(NotFound()); } TagA = await _context.TagA.FindAsync(id); if (TagA != null) { _context.TagA.Remove(TagA); await _context.SaveChangesAsync(); } return(RedirectToPage("./Index")); }
// To protect from overposting attacks, enable the specific properties you want to bind to, for // more details, see https://aka.ms/RazorPagesCRUD. public async Task <IActionResult> OnPostAsync() { if (!ModelState.IsValid) { return(Page()); } _context.Person.Add(Person); try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { // use an optimistic concurrency strategy from: // https://docs.microsoft.com/en-us/ef/core/saving/concurrency#resolving-concurrency-conflicts _context.SaveChanges(); } return(RedirectToPage("./Index")); }