public async Task <IActionResult> Detail(long id) { //编辑 var model = await _service.GetByIdAsync(id); if (model == null) { throw new VinoDataNotFoundException("无法取得数据!"); } return(View(model)); }
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 DeliveryTempletDto(); ViewData["Mode"] = "Add"; } }