FromPrefixedQueryAttribute Class
Specifies that a parameter or property should be bound from query string parameters using the specified prefix.
public sealed class FromPrefixedQueryAttribute : System.Attribute, Microsoft.AspNetCore.Mvc.ModelBinding.IBindingSourceMetadata, Microsoft.AspNetCore.Mvc.ModelBinding.IModelNameProvider, Microsoft.AspNetCore.Http.Metadata.IFromQueryMetadataInheritance System.Object 🡒 System.Attribute 🡒 FromPrefixedQueryAttribute
Implements Microsoft.AspNetCore.Mvc.ModelBinding.IBindingSourceMetadata, Microsoft.AspNetCore.Mvc.ModelBinding.IModelNameProvider, Microsoft.AspNetCore.Http.Metadata.IFromQueryMetadata
Constructors
Section titled “Constructors”FromPrefixedQueryAttribute(string) Constructor
Section titled “FromPrefixedQueryAttribute(string) Constructor”Initializes a new instance of the FromPrefixedQueryAttribute class with the specified query parameter prefix.
public FromPrefixedQueryAttribute(string prefix);Parameters
Section titled “Parameters”prefix System.String
The prefix to prepend to query parameter names during binding.
Properties
Section titled “Properties”FromPrefixedQueryAttribute.BindingSource Property
Section titled “FromPrefixedQueryAttribute.BindingSource Property”Gets the Microsoft.AspNetCore.Mvc.ModelBinding.BindingSource for this attribute, which is a PrefixedQueryBindingSource using the configured Prefix.
public Microsoft.AspNetCore.Mvc.ModelBinding.BindingSource? BindingSource { get; }Implements BindingSource
Property Value
Section titled “Property Value”Microsoft.AspNetCore.Mvc.ModelBinding.BindingSource
FromPrefixedQueryAttribute.Description Property
Section titled “FromPrefixedQueryAttribute.Description Property”Gets or sets an optional description for the prefixed query parameters.
public string? Description { get; set; }Property Value
Section titled “Property Value”FromPrefixedQueryAttribute.Name Property
Section titled “FromPrefixedQueryAttribute.Name Property”Gets or sets the model name used for binding. If null, the parameter name is used.
public string? Name { get; set; }Property Value
Section titled “Property Value”FromPrefixedQueryAttribute.Prefix Property
Section titled “FromPrefixedQueryAttribute.Prefix Property”Gets the prefix prepended to query parameter names during binding.
public string Prefix { get; }