2 types derived from RequiredAttribute
Microsoft.AspNetCore.Mvc.DataAnnotations.Test (2)
274 instantiations of RequiredAttribute
ApiExplorerWebSite (1)
Aspire.Dashboard (4)
BasicWebSite (10)
FormatterWebSite (16)
HtmlGenerationWebSite (6)
Identity.DefaultUI.WebSite (1)
Identity.ExternalClaims (15)
Pages\Account\LoginWithRecoveryCode.cshtml.cs (1)
36[Required]
Pages\Account\Manage\EnableAuthenticator.cshtml.cs (1)
48[Required]
IdentitySample.DefaultUI (6)
IdentitySample.Mvc (19)
Models\AccountViewModels\ExternalLoginConfirmationViewModel.cs (1)
10[Required]
Models\AccountViewModels\ForgotPasswordViewModel.cs (1)
10[Required]
Models\AccountViewModels\UseRecoveryCodeViewModel.cs (1)
10[Required]
Models\AccountViewModels\VerifyAuthenticatorCodeViewModel.cs (1)
10[Required]
Models\ManageViewModels\AddPhoneNumberViewModel.cs (1)
10[Required]
Models\ManageViewModels\DisplayRecoveryCodesViewModel.cs (1)
10[Required]
Models\ManageViewModels\SetPasswordViewModel.cs (1)
10[Required]
Microsoft.AspNetCore.Components.Forms.Tests (4)
Microsoft.AspNetCore.Diagnostics.Middleware (5)
Logging\RequestHeadersLogEnricherOptions.cs (1)
24[Required]
Microsoft.AspNetCore.Identity.UI (36)
Areas\Identity\Pages\V4\Account\ExternalLogin.cshtml.cs (1)
61[Required]
Areas\Identity\Pages\V4\Account\ForgotPassword.cshtml.cs (1)
39[Required]
Areas\Identity\Pages\V4\Account\LoginWith2fa.cshtml.cs (1)
50[Required]
Areas\Identity\Pages\V4\Account\LoginWithRecoveryCode.cshtml.cs (1)
45[Required]
Areas\Identity\Pages\V4\Account\Manage\DeletePersonalData.cshtml.cs (1)
35[Required]
Areas\Identity\Pages\V4\Account\Manage\Email.cshtml.cs (1)
56[Required]
Areas\Identity\Pages\V4\Account\Manage\EnableAuthenticator.cshtml.cs (1)
65[Required]
Areas\Identity\Pages\V4\Account\Manage\SetPassword.cshtml.cs (1)
41[Required]
Areas\Identity\Pages\V4\Account\ResendEmailConfirmation.cshtml.cs (1)
39[Required]
Areas\Identity\Pages\V5\Account\ExternalLogin.cshtml.cs (1)
61[Required]
Areas\Identity\Pages\V5\Account\ForgotPassword.cshtml.cs (1)
39[Required]
Areas\Identity\Pages\V5\Account\LoginWith2fa.cshtml.cs (1)
50[Required]
Areas\Identity\Pages\V5\Account\LoginWithRecoveryCode.cshtml.cs (1)
45[Required]
Areas\Identity\Pages\V5\Account\Manage\DeletePersonalData.cshtml.cs (1)
35[Required]
Areas\Identity\Pages\V5\Account\Manage\Email.cshtml.cs (1)
56[Required]
Areas\Identity\Pages\V5\Account\Manage\EnableAuthenticator.cshtml.cs (1)
65[Required]
Areas\Identity\Pages\V5\Account\Manage\SetPassword.cshtml.cs (1)
41[Required]
Areas\Identity\Pages\V5\Account\ResendEmailConfirmation.cshtml.cs (1)
39[Required]
Microsoft.AspNetCore.Mvc.ApiExplorer.Test (1)
Microsoft.AspNetCore.Mvc.Core.Test (34)
ModelBinding\Validation\ValidatorCacheTest.cs (1)
69[Required]
Microsoft.AspNetCore.Mvc.Core.TestCommon (1)
Microsoft.AspNetCore.Mvc.DataAnnotations (2)
Microsoft.AspNetCore.Mvc.DataAnnotations.Test (18)
Microsoft.AspNetCore.Mvc.IntegrationTests (37)
Microsoft.AspNetCore.Mvc.NewtonsoftJson.Test (1)
src\Mvc\Mvc.Core\test\Formatters\JsonInputFormatterTestBase.cs (1)
674[Required]
Microsoft.AspNetCore.Mvc.RazorPages.Test (2)
Microsoft.AspNetCore.Mvc.ViewFeatures.Test (6)
Microsoft.AspNetCore.OpenApi.Tests (8)
Microsoft.Extensions.AmbientMetadata.Application (2)
Microsoft.Extensions.Compliance.Testing (1)
Microsoft.Extensions.Diagnostics.ResourceMonitoring (1)
Microsoft.Extensions.Http.Diagnostics (5)
Microsoft.Extensions.Http.Resilience (15)
Microsoft.Extensions.Telemetry.Abstractions (3)
RazorPagesWebSite (7)
Sample (2)
TagHelpersWebSite (1)
XmlFormattersWebSite (4)
86 references to RequiredAttribute
Microsoft.Analyzers.Local.Tests (1)
Microsoft.AspNetCore.Mvc.Core (1)
Microsoft.AspNetCore.Mvc.Core.Test (22)
Microsoft.AspNetCore.Mvc.Core.TestCommon (1)
Microsoft.AspNetCore.Mvc.DataAnnotations (10)
Microsoft.AspNetCore.Mvc.DataAnnotations.Test (24)
DataAnnotationsMetadataProviderTest.cs (18)
1108var required = new RequiredAttribute();
1164var attribute = Assert.Single(context.ValidationMetadata.ValidatorMetadata, m => m is RequiredAttribute);
1165Assert.True(((RequiredAttribute)attribute).AllowEmptyStrings); // non-Default for [Required]
1189var attribute = Assert.Single(context.ValidationMetadata.ValidatorMetadata, m => m is RequiredAttribute a);
1190Assert.Equal("Test", ((RequiredAttribute)attribute).ErrorMessage);
1191Assert.False(((RequiredAttribute)attribute).AllowEmptyStrings); // Default for [Required]
1219Assert.DoesNotContain(context.ValidationMetadata.ValidatorMetadata, m => m is RequiredAttribute);
1240Assert.Contains(context.ValidationMetadata.ValidatorMetadata, m => m is RequiredAttribute);
1259Assert.Contains(context.ValidationMetadata.ValidatorMetadata, m => m is RequiredAttribute);
1278Assert.DoesNotContain(context.ValidationMetadata.ValidatorMetadata, m => m is RequiredAttribute);
1299Assert.DoesNotContain(context.ValidationMetadata.ValidatorMetadata, m => m is RequiredAttribute);
1319Assert.Contains(context.ValidationMetadata.ValidatorMetadata, m => m is RequiredAttribute);
1338Assert.Contains(context.ValidationMetadata.ValidatorMetadata, m => m is RequiredAttribute);
1357Assert.Contains(context.ValidationMetadata.ValidatorMetadata, m => m is RequiredAttribute);
1376Assert.DoesNotContain(context.ValidationMetadata.ValidatorMetadata, m => m is RequiredAttribute);
1397Assert.DoesNotContain(context.ValidationMetadata.ValidatorMetadata, m => m is RequiredAttribute);
1418Assert.Contains(context.ValidationMetadata.ValidatorMetadata, m => m is RequiredAttribute);
1439Assert.DoesNotContain(context.ValidationMetadata.ValidatorMetadata, m => m is RequiredAttribute);
Microsoft.AspNetCore.OpenApi (2)
Microsoft.Extensions.Compliance.Redaction (1)
Microsoft.Extensions.Diagnostics.Probes (1)
Microsoft.Extensions.Diagnostics.ResourceMonitoring (1)
Microsoft.Extensions.Http.Resilience (1)
Microsoft.Extensions.Telemetry (1)
Shared (1)
System.ComponentModel.Annotations (18)
System.ComponentModel.DataAnnotations (1)