Table of Contents

TryParse Method

Definition

Namespace
Codebelt.Extensions.Asp.Versioning
Assemblies
Codebelt.Extensions.Asp.Versioning.dll
Source
src/Codebelt.Extensions.Asp.Versioning/ApiVersionAliasParser.cs

TryParse(ReadOnlySpan<char>, out ApiVersion)

Tries to parse the specified text into an API version by resolving aliases before using the fallback parser.

public virtual bool TryParse(ReadOnlySpan<char> text, out ApiVersion apiVersion)

Parameters

text ReadOnlySpan<char>

The API version text to parse.

apiVersion ApiVersion

When this method returns, contains the API version that matched either an alias or the fallback parser; otherwise, contains null.

Returns

bool

true if text matched an alias or was accepted by the fallback parser; otherwise, false.

Remarks

Override this method to customize alias resolution while preserving the same parse contract.