File: src\aspnetcore\src\Shared\AntiforgeryMetadata.cs
Web Access
Project: src\aspnetcore\src\Http\Routing\src\Microsoft.AspNetCore.Routing.csproj (Microsoft.AspNetCore.Routing)
// 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.Antiforgery;

namespace Microsoft.AspNetCore.Http.Metadata;

internal sealed class AntiforgeryMetadata(bool required) : IAntiforgeryMetadata
{
    public static readonly IAntiforgeryMetadata ValidationRequired = new AntiforgeryMetadata(true);
    public static readonly IAntiforgeryMetadata ValidationNotRequired = new AntiforgeryMetadata(false);

    public bool RequiresValidation { get; } = required;
}