public async Task <IActionResult> OnPostAsync(int?id) { if (id == null) { return(NotFound()); } AcceptedArticle = await _context.AcceptedArticle.FindAsync(id); if (AcceptedArticle != null) { _context.BibliographicReference.Add(new BibliographicReference { Title = AcceptedArticle.Title, Author = AcceptedArticle.Author, Source = AcceptedArticle.Source, Year = AcceptedArticle.Year, DOI = AcceptedArticle.DOI, SEMethod = AcceptedArticle.SEMethod, Practice = AcceptedArticle.Practice, Method = AcceptedArticle.Method, Participant = AcceptedArticle.Participant, Result = AcceptedArticle.Result }); _context.AcceptedArticle.Remove(AcceptedArticle); await _context.SaveChangesAsync(); } return(RedirectToPage("./Index")); }
public async Task <IActionResult> OnGetAsync(int?id) { if (id == null) { return(NotFound()); } AcceptedArticle = await _context.AcceptedArticle.FirstOrDefaultAsync(m => m.ID == id); if (AcceptedArticle == null) { return(NotFound()); } return(Page()); }