public async Task OnGetAsync(long?id, EmUserMaterialGroupType type = EmUserMaterialGroupType.Picture) { if (id.HasValue) { Dto = await _service.GetByIdAsync(id.Value); if (Dto == null) { throw new KuDataNotFoundException(); } ViewData["Mode"] = "Edit"; } else { Dto = new UserMaterialGroupDto(); Dto.Type = type; ViewData["Mode"] = "Add"; } }
public void OnGet(EmUserMaterialGroupType type = EmUserMaterialGroupType.Picture) { Type = type; }