QueryAttribute Class
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.
Defines a query string to be used in the API request.
public ref class QueryAttribute sealed : Attribute
[System.AttributeUsage(System.AttributeTargets.Parameter)]
[System.Diagnostics.Conditional("CODE_GENERATION_ATTRIBUTES")]
public sealed class QueryAttribute : Attribute
[<System.AttributeUsage(System.AttributeTargets.Parameter)>]
[<System.Diagnostics.Conditional("CODE_GENERATION_ATTRIBUTES")>]
type QueryAttribute = class
inherit Attribute
Public NotInheritable Class QueryAttribute
Inherits Attribute
- Inheritance
- Attributes
[AutoClient("MyClient")]
interface IMyDependencyClient
{
[Get("/api/users")]
Task<string> GetUsersAsync([Query] string userName, [Query("id")] string userId, CancellationToken cancellationToken = default);
}
Marks a method parameter as a query string for the request.
Query |
Initializes a new instance of the QueryAttribute class. |
Query |
Initializes a new instance of the QueryAttribute class. |
Key |
Gets the query key, if set. |
Termék | Verziók |
---|---|
.NET | 6 (package-provided), 7 (package-provided), 8 (package-provided), 9 (package-provided), 10 (package-provided) |
.NET-visszajelzés
A(z) .NET egy nyílt forráskód projekt. Visszajelzés adásához válasszon egy hivatkozást: