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