コード例 #1
0
ファイル: Detail.cshtml.cs プロジェクト: yuyu2you/Ku.Core.CMS
        public async Task OnGetAsync(long id)
        {
            Dto = await _service.GetByIdAsync(id);

            if (Dto == null)
            {
                throw new KuDataNotFoundException();
            }
        }
コード例 #2
0
ファイル: Edit.cshtml.cs プロジェクト: billydong/Ku.Core.CMS
        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";
            }
        }