protected override async Task OnParametersSetAsync() { if (Id != null) { _surveyId = Guid.Parse(Id); var survey = await SurveyClient.GetSurvey(_surveyId); SurveyName = survey.Name; SurveyIntro = survey.Intro; var responses = await SurveyResponseClient.GetSurveyResponses(_surveyId); Responses = responses.ToList(); } }
protected override async Task OnParametersSetAsync() { Console.WriteLine("Edit Survey Page : OnParametersSetAsync #1 "); if (Id != "") { Console.WriteLine("Get from server, no cache"); _id = Guid.Parse(Id); survey = await SurveyClient.GetSurvey(_id); } else { Console.WriteLine("Use cache"); survey = SurveyClient.CachedSurvey; } CanEdit = (survey.Status == SurveyDefinitionStatusEnum.Edit); }