public override int Compare(object x, object y) { NumericVersion left = x as NumericVersion; NumericVersion right = y as NumericVersion; return(left.Version - right.Version); }
public override bool Equals(object obj) { NumericVersion version = obj as NumericVersion; if (object.ReferenceEquals(version, null)) { return(false); } return(object.Equals(this.Version, version.Version)); }
public void InsertVersion(VersionBase version, ISession session) { NumericVersion numericVersion = version as NumericVersion; if (!numericVersion.CreatedOn.HasValue) { numericVersion.CreatedOn = DateTime.UtcNow; } numericVersion.UpdatedOn = DateTime.UtcNow; session.SaveOrUpdate(version); }
public bool HasExecutedScript(VersionBase currentVersion, VersionBase targetVersion, IDatabaseTask task) { if (currentVersion != null) { NumericVersion currentNumericVersion = currentVersion as NumericVersion; NumericVersion targetNumericVersion = targetVersion as NumericVersion; if (currentNumericVersion.Version.Equals(targetNumericVersion.Version)) { return(currentNumericVersion.HasExecutedTask(task)); } } return(false); }
public NumericVersionTask(NumericVersion version, string scriptName) : base(scriptName) { this.Version = version; }