-
Notifications
You must be signed in to change notification settings - Fork 9.8k
/
ActionConstraintProviderContext.cs
48 lines (41 loc) · 1.64 KB
/
ActionConstraintProviderContext.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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc.Abstractions;
namespace Microsoft.AspNetCore.Mvc.ActionConstraints;
/// <summary>
/// Context for an action constraint provider.
/// </summary>
public class ActionConstraintProviderContext
{
/// <summary>
/// Creates a new <see cref="ActionConstraintProviderContext"/>.
/// </summary>
/// <param name="context">The <see cref="Http.HttpContext"/> associated with the request.</param>
/// <param name="action">The <see cref="ActionDescriptor"/> for which constraints are being created.</param>
/// <param name="items">The list of <see cref="ActionConstraintItem"/> objects.</param>
public ActionConstraintProviderContext(
HttpContext context,
ActionDescriptor action,
IList<ActionConstraintItem> items)
{
ArgumentNullException.ThrowIfNull(context);
ArgumentNullException.ThrowIfNull(action);
ArgumentNullException.ThrowIfNull(items);
HttpContext = context;
Action = action;
Results = items;
}
/// <summary>
/// The <see cref="Http.HttpContext"/> associated with the request.
/// </summary>
public HttpContext HttpContext { get; }
/// <summary>
/// The <see cref="ActionDescriptor"/> for which constraints are being created.
/// </summary>
public ActionDescriptor Action { get; }
/// <summary>
/// The list of <see cref="ActionConstraintItem"/> objects.
/// </summary>
public IList<ActionConstraintItem> Results { get; }
}