// 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(ArticleSource).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!ArticleSourceExists(ArticleSource.Id)) { 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) { return(Page()); } _context.VideoSources.Add(VideoSource); await _context.SaveChangesAsync(); return(RedirectToPage("./Index")); }
public async Task <IActionResult> OnPostAsync(int?id) { if (id == null) { return(NotFound()); } ArticleSource = await _context.ArticleSources.FindAsync(id); if (ArticleSource != null) { _context.ArticleSources.Remove(ArticleSource); await _context.SaveChangesAsync(); } return(RedirectToPage("./Index")); }
public async Task <IActionResult> OnPostAsync(int?id) { if (id == null) { return(NotFound()); } TvProgram = await _context.TvPrograms.FindAsync(id); if (TvProgram != null) { _context.TvPrograms.Remove(TvProgram); await _context.SaveChangesAsync(); } return(RedirectToPage("./Index")); }
public async Task <IActionResult> OnPostAsync(int?id) { if (id == null) { return(NotFound()); } DefaultSchedule = await _context.DefaultSchedules.FindAsync(id); if (DefaultSchedule != null) { _context.DefaultSchedules.Remove(DefaultSchedule); await _context.SaveChangesAsync(); } return(RedirectToPage("./Index")); }
public async Task <IActionResult> OnPostAsync(int?id) { if (id == null) { return(NotFound()); } Corner = await _context.Corners.FindAsync(id); if (Corner != null) { _context.Corners.Remove(Corner); await _context.SaveChangesAsync(); } return(RedirectToPage("./Index")); }