public async Task <List <Recommendation> > GenerateRecommendationsToSaveDeploymentProject()
        {
            if (_recipeDefinitionPaths == null)
            {
                throw new InvalidOperationException($"{nameof(_recipeDefinitionPaths)} is null as part of the orchestartor object");
            }
            if (_session == null)
            {
                throw new InvalidOperationException($"{nameof(_session)} is null as part of the orchestartor object");
            }

            var engine = new RecommendationEngine.RecommendationEngine(_recipeDefinitionPaths, _session);

            return(await engine.ComputeRecommendations());
        }
        public async Task <List <Recommendation> > GenerateDeploymentRecommendations()
        {
            if (_recipeDefinitionPaths == null)
            {
                throw new InvalidOperationException($"{nameof(_recipeDefinitionPaths)} is null as part of the orchestartor object");
            }
            if (_session == null)
            {
                throw new InvalidOperationException($"{nameof(_session)} is null as part of the orchestartor object");
            }

            var targetApplicationFullPath = new DirectoryInfo(_session.ProjectDefinition.ProjectPath).FullName;
            var solutionDirectoryPath     = !string.IsNullOrEmpty(_session.ProjectDefinition.ProjectSolutionPath) ?
                                            new DirectoryInfo(_session.ProjectDefinition.ProjectSolutionPath).Parent.FullName : string.Empty;

            var customRecipePaths = await LocateCustomRecipePaths(targetApplicationFullPath, solutionDirectoryPath);

            var engine = new RecommendationEngine.RecommendationEngine(_recipeDefinitionPaths.Union(customRecipePaths), _session);
            var additionalReplacements = await GetReplacements();

            return(await engine.ComputeRecommendations(additionalReplacements));
        }
        public async Task <List <Recommendation> > GenerateRecommendationsFromSavedDeploymentProject(string deploymentProjectPath)
        {
            if (_session == null)
            {
                throw new InvalidOperationException($"{nameof(_session)} is null as part of the orchestartor object");
            }
            if (_directoryManager == null)
            {
                throw new InvalidOperationException($"{nameof(_directoryManager)} is null as part of the orchestartor object");
            }
            if (!_directoryManager.Exists(deploymentProjectPath))
            {
                throw new InvalidCliArgumentException($"The path '{deploymentProjectPath}' does not exists on the file system. Please provide a valid deployment project path and try again.");
            }

            var engine = new RecommendationEngine.RecommendationEngine(new List <string> {
                deploymentProjectPath
            }, _session);
            var additionalReplacements = await GetReplacements();

            return(await engine.ComputeRecommendations(additionalReplacements));
        }