public async Task <ActionResult <DraftNotificationSummaryForConsent> > GetDraftNotificationSummaryForConsentByIdAsync(string notificationId) { var notificationEntity = await this.notificationDataRepository.GetAsync( NotificationDataTableNames.DraftNotificationsPartition, notificationId); if (notificationEntity == null) { return(this.NotFound()); } var groupNames = await this.groupsService .GetByIdsAsync(notificationEntity.Groups) .Select(x => x.DisplayName). ToListAsync(); var result = new DraftNotificationSummaryForConsent { NotificationId = notificationId, TeamNames = await this.teamDataRepository.GetTeamNamesByIdsAsync(notificationEntity.Teams), RosterNames = await this.teamDataRepository.GetTeamNamesByIdsAsync(notificationEntity.Rosters), GroupNames = groupNames, AllUsers = notificationEntity.AllUsers, }; return(this.Ok(result)); }
public async Task <ActionResult <DraftNotificationSummaryForConsent> > GetDraftNotificationSummaryForConsentByIdAsync(string notificationId) { var notificationEntity = await this.notificationDataRepository.GetAsync( PartitionKeyNames.NotificationDataTable.DraftNotificationsPartition, notificationId); if (notificationEntity == null) { return(this.NotFound()); } List <string> adGroupNames = new List <string>(); if (notificationEntity.ADGroups.Count() > 0) { var entities = await this.adGroupsDataRepository.GetADGroupsList(notificationEntity.ADGroups.ToList()); for (int i = 0; i < entities.Count; i++) { adGroupNames.Add(entities[i].DisplayName.ToString()); } } var result = new DraftNotificationSummaryForConsent { NotificationId = notificationId, TeamNames = await this.teamDataRepository.GetTeamNamesByIdsAsync(notificationEntity.Teams), RosterNames = await this.teamDataRepository.GetTeamNamesByIdsAsync(notificationEntity.Rosters), ADGroups = adGroupNames, AllUsers = notificationEntity.AllUsers, }; return(this.Ok(result)); }
public async Task <ActionResult <DraftNotificationSummaryForConsent> > GetDraftNotificationSummaryForConsentByIdAsync(string notificationId) { var notificationEntity = await this.notificationDataRepository.GetAsync( PartitionKeyNames.NotificationDataTable.DraftNotificationsPartition, notificationId); if (notificationEntity == null) { return(this.NotFound()); } var result = new DraftNotificationSummaryForConsent { NotificationId = notificationId, TeamNames = await this.teamDataRepository.GetTeamNamesByIdsAsync(notificationEntity.Teams), RosterNames = await this.teamDataRepository.GetTeamNamesByIdsAsync(notificationEntity.Rosters), AllUsers = notificationEntity.AllUsers, }; return(this.Ok(result)); }