-
Notifications
You must be signed in to change notification settings - Fork 9.8k
/
ApiConventionNameMatchAttribute.cs
31 lines (28 loc) · 1.27 KB
/
ApiConventionNameMatchAttribute.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
29
30
31
// 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.Mvc.ApiExplorer;
/// <summary>
/// Determines the matching behavior an API convention method or parameter by name.
/// <see cref="ApiConventionNameMatchBehavior"/> for supported options.
/// <seealso cref="ApiConventionTypeAttribute"/>.
/// </summary>
/// <remarks>
/// <see cref="ApiConventionNameMatchBehavior.Exact"/> is used if no value for this
/// attribute is specified on a convention method or parameter.
/// </remarks>
[AttributeUsage(AttributeTargets.Parameter | AttributeTargets.Method, AllowMultiple = false, Inherited = false)]
public sealed class ApiConventionNameMatchAttribute : Attribute
{
/// <summary>
/// Initializes a new instance of <see cref="ApiConventionNameMatchAttribute"/>.
/// </summary>
/// <param name="matchBehavior">The <see cref="ApiConventionNameMatchBehavior"/>.</param>
public ApiConventionNameMatchAttribute(ApiConventionNameMatchBehavior matchBehavior)
{
MatchBehavior = matchBehavior;
}
/// <summary>
/// Gets the <see cref="ApiConventionNameMatchBehavior"/>.
/// </summary>
public ApiConventionNameMatchBehavior MatchBehavior { get; }
}