public ProjectFilePortingResponse PortingProjects()

in src/PortingAssistantExtensionServer/Services/PortingService.cs [60:104]


        public ProjectFilePortingResponse PortingProjects(ProjectFilePortingRequest request)
        {
            try
            {
                if (ProjectPathToDetails == null || ProjectPathToDetails.Count == 0)
                {
                    return new ProjectFilePortingResponse()
                    {
                        Success = false,
                        messages = new List<string>() { "Please run a full assessment before porting" },
                        SolutionPath = request.SolutionPath
                    };
                }

                var portingRequst = new PortingRequest
                {

                    Projects = ProjectPathToDetails.Where(p => p.Value != null && request.ProjectPaths.Contains(p.Value.ProjectFilePath)).Select(p => p.Value).ToList(),
                    SolutionPath = request.SolutionPath,
                    RecommendedActions = GenerateRecommendedActions(request),
                    TargetFramework = request.TargetFramework,
                    IncludeCodeFix = request.IncludeCodeFix
                };
                _logger.LogInformation($"start porting ${request} .....");
                var results = _client.ApplyPortingChanges(portingRequst);
                CreateClientConnectionAsync(request.PipeName);
                _logger.LogInformation($"porting success ${request.SolutionPath}");
                return new ProjectFilePortingResponse()
                {
                    Success = results.All(r => r.Success),
                    messages = results.Select(r => r.Message).ToList(),
                    SolutionPath = request.SolutionPath
                };
            }
            catch (Exception ex)
            {
                _logger.LogError(ex, "failed to port projects: ");
                return new ProjectFilePortingResponse()
                {
                    Success = false,
                    messages = new List<string>() { ex.Message },
                    SolutionPath = request.SolutionPath
                };
            }
        }