using System; using System.Collections.Generic; using System.Linq; using CTA.Rules.Models; using CTA.Rules.ProjectFile; namespace CTA.Rules.Actions { /// /// List of actions that can run on the project /// public class ProjectFileActions { public Func, Dictionary, List, List, string> GetMigrateProjectFileAction(string _) { static string func(string projectDir, ProjectType projectType, List targetVersion, Dictionary packageReferences, List projectReferences, List metaReferences) { bool result = false; try { var projectFileCreator = new ProjectFileCreator( projectDir, targetVersion, packageReferences, projectReferences.ToList(), projectType, metaReferences); result = projectFileCreator.Create(); } catch (Exception) { // exception is already logged in constructor } return result ? "Project file created" : string.Empty; } return func; } } }