/// <summary> /// <para> /// Initializes a new instance of a <see cref="Evolve"/> with the given <paramref name="evolveConfigurationPath"/>. /// </para> /// <para> /// This constructor is used to evolve .NET projects. /// </para> /// </summary> /// <param name="evolveConfigurationPath"> Evolve configuration file (can be relative). </param> /// <param name="dbConnection"> Optional database connection. </param> /// <param name="logInfoDelegate"> Optional logger. </param> public Evolve(string evolveConfigurationPath, IDbConnection dbConnection = null, Action <string> logInfoDelegate = null) { _configurationPath = Check.FileExists(ResolveConfigurationFileLocation(evolveConfigurationPath), nameof(evolveConfigurationPath)); _userDbConnection = dbConnection; _logInfoDelegate = logInfoDelegate ?? new Action <string>((msg) => { }); // Configure Evolve var configurationProvider = ConfigurationFactoryProvider.GetProvider(evolveConfigurationPath); configurationProvider.Configure(evolveConfigurationPath, this); }
/// <summary> /// <para> /// Initializes a new instance of a <see cref="Evolve"/> with the given /// <paramref name="evolveConfigurationPath"/>, <paramref name="depsFile"/> and <paramref name="nugetPackageDir"/> /// </para> /// <para> /// This constructor is used to evolve .NET Standard/Core projects. /// </para> /// </summary> /// <param name="evolveConfigurationPath"> Evolve configuration file (can be relative). </param> /// <param name="depsFile"> Dependency file of the project to migrate (can be relative). </param> /// <param name="nugetPackageDir"> Path to the NuGet package folder. </param> /// <param name="dbConnection"> Optional database connection. </param> /// <param name="logInfoDelegate"> Optional logger. </param> /// <param name="environmentName"> The environment is typically set to one of Development, Staging, or Production. Optional. </param> public Evolve(string evolveConfigurationPath, string depsFile, string nugetPackageDir, IDbConnection dbConnection = null, Action <string> logInfoDelegate = null, string environmentName = "") { _configurationPath = Check.FileExists(ResolveConfigurationFileLocation(evolveConfigurationPath), nameof(evolveConfigurationPath)); _depsFile = Check.FileExists(ResolveConfigurationFileLocation(depsFile), nameof(depsFile)); _nugetPackageDir = Check.DirectoryExists(nugetPackageDir, nameof(nugetPackageDir)); _userDbConnection = dbConnection; _logInfoDelegate = logInfoDelegate ?? new Action <string>((msg) => { }); _environmentName = environmentName; // Configure Evolve var configurationProvider = ConfigurationFactoryProvider.GetProvider(evolveConfigurationPath); configurationProvider.Configure(evolveConfigurationPath, this, environmentName); }