-
Notifications
You must be signed in to change notification settings - Fork 9.8k
/
SupplyParameterFromFormAttribute.cs
28 lines (24 loc) · 1.14 KB
/
SupplyParameterFromFormAttribute.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
namespace Microsoft.AspNetCore.Components;
/// <summary>
/// Indicates that the value of the associated property should be supplied from
/// the form data for the form with the specified name.
/// </summary>
[AttributeUsage(AttributeTargets.Property, AllowMultiple = false, Inherited = true)]
public sealed class SupplyParameterFromFormAttribute : CascadingParameterAttributeBase
{
/// <summary>
/// Gets or sets the name of the form value. If not specified, the property name will be used.
/// </summary>
public string? Name { get; set; }
/// <summary>
/// Gets or sets the name of the form that provides this value. If not specified,
/// the value will be mapped from any incoming form post within the current form
/// mapping scope. If specified, the value will only be mapped from a form with
/// the specified name in the current mapping scope.
/// </summary>
public string? FormName { get; set; }
/// <inheritdoc />
internal override bool SingleDelivery => true;
}