Skip to content

Commit 3aae49e

Browse files
committed
Update TryParse documentation to clarify namespace identifier requirements for versioning
1 parent 96b23db commit 3aae49e

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

src/Abstractions/src/Asp.Versioning.Abstractions/NamespaceParser.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,9 @@ public IReadOnlyList<ApiVersion> Parse( Type type )
142142
/// <summary>
143143
/// Attempts to parse an API version from the specified namespace identifier.
144144
/// </summary>
145-
/// <param name="identifier">The namespace identifier to parse.</param>
145+
/// <param name="identifier">The namespace identifier to parse. The identifier must start with
146+
/// 'v', 'V', or '_' followed by a digit. The '_' prefix supports folder names that start with
147+
/// a number, which causes Visual Studio to prepend an underscore to the namespace.</param>
146148
/// <param name="apiVersion">The parsed <see cref="ApiVersion">API version</see> or <c>null</c>.</param>
147149
/// <returns>True if parsing is successful; otherwise, false.</returns>
148150
protected virtual bool TryParse( Text identifier, out ApiVersion? apiVersion )
@@ -164,6 +166,9 @@ protected virtual bool TryParse( Text identifier, out ApiVersion? apiVersion )
164166
// - v2_0_Beta
165167
// - v20180401
166168
// - v2018_04_01_1_1_Beta
169+
// - _1
170+
// - _1_1
171+
// - _20180401
167172
// - _2018_04_01
168173
var ch = identifier[0];
169174

0 commit comments

Comments
 (0)