CommandRouteBuilderBase<TBuilder>.WithCommand Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Overloads
| Name | Description |
|---|---|
| WithCommand(String) |
Match a specific command name. |
| WithCommand(Regex) |
Match a specific command name pattern. |
WithCommand(String)
Match a specific command name.
public TBuilder WithCommand(string command);
member this.WithCommand : string -> 'Builder
Public Function WithCommand (command As String) As TBuilder
Parameters
- command
- String
The command string to be matched. This parameter cannot be null or whitespace.
Returns
The current instance of the builder, allowing for method chaining.
Exceptions
Command has already been defined for this builder instance.
Applies to
WithCommand(Regex)
Match a specific command name pattern.
public TBuilder WithCommand(System.Text.RegularExpressions.Regex commandPattern);
member this.WithCommand : System.Text.RegularExpressions.Regex -> 'Builder
Public Function WithCommand (commandPattern As Regex) As TBuilder
Parameters
- commandPattern
- Regex
The command Regex pattern to be matched. This parameter cannot be null.
Returns
The current instance of the builder, allowing for method chaining.
Exceptions
Command has already been defined for this builder instance.