public async Task <IActionResult> OnGetAsync(int?id) { if (id == null) { return(NotFound()); } ConfigChart = await _configChartService.GetConfigChartById(id); if (ConfigChart == null) { return(NotFound()); } return(Page()); }
public async Task <IActionResult> OnPostAsync(int?id) { if (id == null) { return(NotFound()); } ConfigChart = await _configChartService.GetConfigChartById(id); if (ConfigChart != null) { await _configChartService.RemoveConfigChart(id); } return(RedirectToPage("./Index")); }
public async Task <IActionResult> OnGetAsync(int?id) { if (id == null) { return(NotFound()); } ConfigChart = await _context.ConfigCharts .Include(c => c.Category) .Include(c => c.ConfigGroup).FirstOrDefaultAsync(m => m.Id == id); if (ConfigChart == null) { return(NotFound()); } ViewData["CategoryId"] = new SelectList(_context.Categories, "Id", "Id"); ViewData["ConfigGroupId"] = new SelectList(_context.ConfigGroups, "Id", "Id"); return(Page()); }