/// <summary> /// Initializes a new instance of the <see cref="AssemblyVersion"/> class. /// </summary> /// <exception cref="EvolveCoreDriverException"></exception> public AssemblyVersion(string version) { Version = Check.NotNullOrEmpty(version, nameof(version)); if (!MatchPattern.IsMatch(Version)) { throw new EvolveCoreDriverException(string.Format(InvalidVersionPatternMatching, Version)); } VersionParts = Version.Split('.').Select(long.Parse).ToList(); }
/// <summary> /// Constructor. /// </summary> /// <param name="version"> Version of the script. Example: 1_1_0_11 </param> /// <exception cref="EvolveConfigurationException"> Thrown when the format of the version is invalid. </exception> public MigrationVersion(string version) { Check.NotNullOrEmpty(version, nameof(version)); Label = version.Replace('_', '.'); if (!MatchPattern.IsMatch(Label)) { throw new EvolveConfigurationException(string.Format(InvalidVersionPatternMatching, Label)); } VersionParts = Label.Split('.').Select(long.Parse).ToList(); }