コード例 #1
0
        /// <summary>
        /// Get Sonar issues corresponding to the <see cref="SonarRequestGetIssues"/> parameters.
        /// </summary>
        /// <param name="sonarSettingRequest">The parameters used to get the issues.</param>
        /// <returns>A list of Sonar issues with ActiveDirectory, ChangeSet and CodeProject informations.</returns>
        public IssuesSonarSet GetIssuesSonar(SonarRequestGetIssues sonarSettingRequest)
        {
            if (sonarSettingRequest == null)
            {
                return(null);
            }

            _loggingService.LogInfo(this, "Parameters : DateFrom " + sonarSettingRequest.DateFrom.ToString() + ", DateTo " + sonarSettingRequest.DateFrom.ToString());

            GroupADSet groupADSet = _activeDirectoryService.GetUsersByGroupAd(sonarSettingRequest.GroupAdSet);

            sonarSettingRequest.Users = groupADSet?.GetListOfUser();

            SearchIssuesResponse searchIssuesResponse = _sonarConnector.GetIssuesAsync(sonarSettingRequest).Result;
            List <Issue>         issueSet             = searchIssuesResponse.CreateIssueSet(groupADSet, _mapper, _sonarConnector, _tfsConnector);

            _loggingService.LogInfo(this, issueSet.Count().ToString() + " resultats. Parameters : DateFrom " + sonarSettingRequest.DateFrom.ToString() + ", DateTo " + sonarSettingRequest.DateTo.ToString());

            return(new IssuesSonarSet()
            {
                IssueSet = issueSet
            });
        }