Class ValueSourceAttribute
Overrides the default binding behavior for a typed handler request property.
Inherited Members
Namespace: NanoRoute.HandlerExtensions
Assembly: NanoRoute.dll
Syntax
[AttributeUsage(AttributeTargets.Property, AllowMultiple = false)]
public sealed class ValueSourceAttribute : Attribute
Constructors
ValueSourceAttribute(ValueSource)
Overrides the default binding behavior for a typed handler request property.
Declaration
public ValueSourceAttribute(ValueSource source)
Parameters
| Type | Name | Description |
|---|---|---|
| ValueSource | source | The source used to populate the annotated property. |
Properties
Name
Gets or sets an optional binding name.
Declaration
public string? Name { get; init; }
Property Value
| Type | Description |
|---|---|
| string |
Remarks
For Context, this overrides the key looked up in Parameters. For ServiceLocator, this is treated as the keyed service name. Skip does not allow a name because no value is read.
Source
Gets the binding source used for the annotated property.
Declaration
public ValueSource Source { get; }
Property Value
| Type | Description |
|---|---|
| ValueSource |