コード例 #1
0
            public override int Compare(object x, object y)
            {
                NumericVersion left  = x as NumericVersion;
                NumericVersion right = y as NumericVersion;

                return(left.Version - right.Version);
            }
コード例 #2
0
        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));
        }
コード例 #3
0
        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);
        }
コード例 #4
0
        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);
        }
コード例 #5
0
 public NumericVersionTask(NumericVersion version, string scriptName)
     : base(scriptName)
 {
     this.Version = version;
 }