Exemplo n.º 1
0
        public async Task OnGetAsync(long id)
        {
            Dto = await _service.GetByIdAsync(id);

            if (Dto == null)
            {
                throw new KuDataNotFoundException();
            }
        }
Exemplo n.º 2
0
        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";
            }
        }