public async Task OnGet(string userId) { var spec = new MemberByUserIdWithBooksReadAndMemberSubscriptionsSpec(userId); var member = await _memberRepository.GetBySpecAsync(spec); if (member == null) { // TODO: Add logging BadRequest(); } #pragma warning disable CS0436 // Type conflicts with imported type UserDetailsViewModel = new UserDetailsViewModel(member !); #pragma warning restore CS0436 // Type conflicts with imported type int percentageNum = _memberSubscriptionPeriodCalculationsService.GetPercentageProgressToAlumniStatus(member !); PercentModel.Percentage = percentageNum; }
public async Task <ActionResult> OnGet(string userId) { var spec = new MemberByUserIdWithBooksReadAndMemberSubscriptionsSpec(userId); var member = await _memberRepository.GetBySpecAsync(spec); if (member == null) { _logger.LogWarning($"No member found for userId {userId}"); return(NotFound()); } #pragma warning disable CS0436 // Type conflicts with imported type UserDetailsViewModel = new UserDetailsViewModel(member !); #pragma warning restore CS0436 // Type conflicts with imported type int percentageNum = _memberSubscriptionPeriodCalculationsService.GetPercentageProgressToAlumniStatus(member !); PercentModel.Percentage = percentageNum; return(Page()); }