Table of Contents

Class SemanticVersion

Namespace
MongoDB.Driver.Core.Misc
Assembly
MongoDB.Driver.dll

Represents a semantic version number.

public class SemanticVersion : IEquatable<SemanticVersion>, IComparable<SemanticVersion>
Inheritance
SemanticVersion
Implements
Inherited Members

Constructors

SemanticVersion(int, int, int)

Initializes a new instance of the SemanticVersion class.

SemanticVersion(int, int, int, string)

Initializes a new instance of the SemanticVersion class.

Properties

CommitHash

Gets the internal build commit hash.

CommitsAfterRelease

Gets the number of commits after release.

Major

Gets the major version.

Minor

Gets the minor version.

Patch

Gets the patch version.

PreRelease

Gets the pre release version.

Methods

CompareTo(SemanticVersion)

Compares the current instance with another object of the same type and returns an integer that indicates whether the current instance precedes, follows, or occurs in the same position in the sort order as the other object.

Equals(SemanticVersion)

Indicates whether the current object is equal to another object of the same type.

Equals(object)

Determines whether the specified object is equal to the current object.

GetHashCode()

Serves as the default hash function.

Parse(string)

Parses a string representation of a semantic version.

ToString()

Returns a string that represents the current object.

TryParse(string, out SemanticVersion)

Tries to parse a string representation of a semantic version.

Operators

operator ==(SemanticVersion, SemanticVersion)

Determines whether two specified semantic versions have the same value.

operator >(SemanticVersion, SemanticVersion)

Determines whether the first specified SemanticVersion is greater than the second specified SemanticVersion.

operator >=(SemanticVersion, SemanticVersion)

Determines whether the first specified SemanticVersion is greater than or equal to the second specified SemanticVersion.

operator !=(SemanticVersion, SemanticVersion)

Determines whether two specified semantic versions have different values.

operator <(SemanticVersion, SemanticVersion)

Determines whether the first specified SemanticVersion is less than the second specified SemanticVersion.

operator <=(SemanticVersion, SemanticVersion)

Determines whether the first specified SemanticVersion is less than or equal to the second specified SemanticVersion.