public async Task <IActionResult> OnPostAsync(int?id) { if (id == null) { return(NotFound()); } SellDocSeriesDef = await _context.SellDocSeriesDefs.FindAsync(id); if (SellDocSeriesDef != null) { _context.SellDocSeriesDefs.Remove(SellDocSeriesDef); await _context.SaveChangesAsync(); } return(RedirectToPage("./Index")); }
public async Task <IActionResult> OnGetAsync(int?id) { if (id == null) { return(NotFound()); } SellDocSeriesDef = await _context.SellDocSeriesDefs .Include(s => s.Company) .Include(s => s.SellDocTypeDef).FirstOrDefaultAsync(m => m.Id == id); if (SellDocSeriesDef == null) { return(NotFound()); } return(Page()); }