Skip to content

Commit af41426

Browse files
Add copy constructor
1 parent 03319e3 commit af41426

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

src/Abstractions/src/Asp.Versioning.Abstractions/ApiVersionMetadata.cs

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,23 @@ public class ApiVersionMetadata
2828
Name = name ?? string.Empty;
2929
}
3030

31+
/// <summary>
32+
/// Initializes a new instance of the <see cref="ApiVersionMetadata"/> class.
33+
/// </summary>
34+
/// <param name="other">The other <see cref="ApiVersionMetadata">instance</see> to initialize from.</param>
35+
protected ApiVersionMetadata( ApiVersionMetadata other )
36+
{
37+
if ( other == null )
38+
{
39+
throw new ArgumentNullException( nameof( other ) );
40+
}
41+
42+
apiModel = other.apiModel;
43+
endpointModel = other.endpointModel;
44+
mergedModel = other.mergedModel;
45+
Name = other.Name;
46+
}
47+
3148
/// <summary>
3249
/// Gets an empty API version information.
3350
/// </summary>

0 commit comments

Comments
 (0)