public async Task OnGetAsync(long id) { Dto = await _service.GetByIdAsync(id); if (Dto == null) { throw new KuDataNotFoundException(); } }
public async Task OnGetAsync(long?id) { if (id.HasValue) { Dto = await _service.GetByIdAsync(id.Value); if (Dto == null) { throw new KuDataNotFoundException(); } ViewData["Mode"] = "Edit"; } else { Dto = new PageViewRecordDto(); ViewData["Mode"] = "Add"; } }