Skip to content

Commit 3f569d2

Browse files
Add copy constructor
1 parent 00c5d3b commit 3f569d2

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

src/Abstractions/src/Asp.Versioning.Abstractions/ApiVersion.cs

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,24 @@ protected internal ApiVersion(
118118
MinorVersion = minorVersion;
119119
}
120120

121+
/// <summary>
122+
/// Initializes a new instance of the <see cref="ApiVersion"/> class.
123+
/// </summary>
124+
/// <param name="other">The instance to derive from.</param>
125+
protected ApiVersion( ApiVersion other )
126+
{
127+
if ( other == null )
128+
{
129+
throw new ArgumentNullException( nameof( other ) );
130+
}
131+
132+
hashCode = other.hashCode;
133+
GroupVersion = other.GroupVersion;
134+
MajorVersion = other.MajorVersion;
135+
MinorVersion = other.MinorVersion;
136+
Status = other.Status;
137+
}
138+
121139
/// <summary>
122140
/// Gets the default API version.
123141
/// </summary>

0 commit comments

Comments
 (0)