67 instantiations of RequiredAttribute
Aspire.Dashboard (4)
Model\Otlp\FilterDialogFormModel.cs (3)
11[Required(ErrorMessageResourceType = typeof(Dialogs), ErrorMessageResourceName = nameof(Dialogs.FieldRequired))] 14[Required(ErrorMessageResourceType = typeof(Dialogs), ErrorMessageResourceName = nameof(Dialogs.FieldRequired))] 19[Required(ErrorMessageResourceType = typeof(Dialogs), ErrorMessageResourceName = nameof(Dialogs.FieldRequired))]
Model\TokenFormModel.cs (1)
11[Required(ErrorMessageResourceType = typeof(Login), ErrorMessageResourceName = nameof(Login.TokenRequiredErrorMessage))]
Microsoft.AspNetCore.Diagnostics.Middleware (5)
Logging\LoggingRedactionOptions.cs (4)
57[Required] 66[Required] 75[Required] 93[Required]
Logging\RequestHeadersLogEnricherOptions.cs (1)
24[Required]
Microsoft.AspNetCore.Mvc.DataAnnotations (2)
DataAnnotationsClientModelValidatorProvider.cs (1)
95new RequiredAttribute(),
DataAnnotationsMetadataProvider.cs (1)
365requiredAttribute = new RequiredAttribute()
Microsoft.DotNet.HotReload.Watch (11)
src\sdk\src\Dotnet.Watch\AspireService\Models\RunSessionRequest.cs (4)
17[Required] 27[Required] 31[Required] 55[Required]
src\sdk\src\Dotnet.Watch\AspireService\Models\SessionChangeNotification.cs (7)
28[Required] 35[Required] 49[Required] 56[Required] 73[Required] 90[Required] 97[Required]
Microsoft.Extensions.AI.Abstractions.Tests (8)
Utilities\AIJsonUtilitiesTests.cs (8)
472[Required] int valueNoDefaultRequired, 477[Required, DefaultValue(5)] int valueWithDefaultValueAttrRequired, 479[Required] int valueWithCSharpDefaultRequired = 5, 481[Required] int? nullableValueWithDefaultRequired = null, 483[Required] string refWithDefaultRequired = "default", 485[Required] string? nullableRefWithDefaultRequired = null) 535[Required] 538[Required]
Microsoft.Extensions.AmbientMetadata.Application (2)
ApplicationMetadata.cs (2)
26[Required] 32[Required]
Microsoft.Extensions.Compliance.Testing (1)
FakeRedactorOptions.cs (1)
23[Required]
Microsoft.Extensions.Diagnostics.ResourceMonitoring (1)
ResourceMonitoringOptions.Windows.cs (1)
19[Required]
Microsoft.Extensions.Http.Diagnostics (6)
Logging\LoggingOptions.cs (6)
49[Required] 91[Required] 97[Required] 110[Required] 123[Required] 150[Required]
Microsoft.Extensions.Http.Resilience (15)
Hedging\HedgingEndpointOptions.cs (3)
26[Required] 39[Required] 53[Required]
Hedging\HttpStandardHedgingResilienceOptions.cs (3)
46[Required] 59[Required] 72[Required]
Resilience\HttpStandardResilienceOptions.cs (5)
38[Required] 51[Required] 64[Required] 77[Required] 91[Required]
Routing\OrderedGroupsRoutingOptions.cs (1)
22[Required]
Routing\UriEndpoint.cs (1)
20[Required]
Routing\WeightedGroupsRoutingOptions.cs (1)
28[Required]
Routing\WeightedUriEndpoint.cs (1)
24[Required]
Microsoft.Extensions.Telemetry (1)
Sampling\RandomProbabilisticSamplerOptions.cs (1)
18[Required]
Microsoft.Extensions.Telemetry.Abstractions (3)
Latency\Registration\LatencyContextRegistrationOptions.cs (3)
17[Required] 23[Required] 29[Required]
Microsoft.Private.Windows.Core (4)
System\Private\Windows\Nrbf\FullyQualifiedTypeName.cs (2)
22[Required] 25[Required]
System\Private\Windows\Ole\DataStore.DataStoreEntry.cs (2)
12[Required] 15[Required]
System.Private.Windows.Core (4)
System\Private\Windows\Nrbf\FullyQualifiedTypeName.cs (2)
22[Required] 25[Required]
System\Private\Windows\Ole\DataStore.DataStoreEntry.cs (2)
12[Required] 15[Required]
48 references to RequiredAttribute
Microsoft.Analyzers.Local.Tests (1)
ApiLifecycle\ApiLifecycleAnalyzerTest.cs (1)
88Assembly.GetAssembly(typeof(RequiredAttribute))!,
Microsoft.AspNetCore.Components.Forms (1)
ClientValidation\DefaultClientValidationService.cs (1)
74case RequiredAttribute:
Microsoft.AspNetCore.Mvc.Core (1)
MvcOptions.cs (1)
104/// Gets or sets a value that determines if the inference of <see cref="RequiredAttribute"/> for
Microsoft.AspNetCore.Mvc.DataAnnotations (10)
DataAnnotationsClientModelValidatorProvider.cs (1)
79hasRequiredAttribute |= attribute is RequiredAttribute;
DataAnnotationsMetadataProvider.cs (2)
322var requiredAttribute = attributes.OfType<RequiredAttribute>().FirstOrDefault();
DataAnnotationsModelValidatorProvider.cs (1)
79if (attribute is RequiredAttribute)
RequiredAttributeAdapter.cs (4)
11/// <see cref="AttributeAdapterBase{TAttribute}"/> for <see cref="RequiredAttribute"/>. 13public sealed class RequiredAttributeAdapter : AttributeAdapterBase<RequiredAttribute> 18/// <param name="attribute">The <see cref="RequiredAttribute"/>.</param> 20public RequiredAttributeAdapter(RequiredAttribute attribute, IStringLocalizer? stringLocalizer)
ValidationAttributeAdapterProvider.cs (2)
34else if (typeof(RequiredAttribute).IsAssignableFrom(type)) 36return new RequiredAttributeAdapter((RequiredAttribute)attribute, stringLocalizer);
Microsoft.Extensions.AI.Abstractions (3)
Utilities\AIJsonUtilities.Schema.Create.cs (3)
134isRequired = isRequired || parameter.GetCustomAttribute<RequiredAttribute>(inherit: true) is not null; 564if (property.AttributeProvider?.GetCustomAttributes(typeof(RequiredAttribute), inherit: true) is { Length: > 0 } || 565property.AssociatedParameter?.AttributeProvider?.GetCustomAttributes(typeof(RequiredAttribute), inherit: true) is { Length: > 0 })
Microsoft.Extensions.Compliance.Redaction (1)
src\Shared\Data.Validation\LengthAttribute.cs (1)
86/// It is assumed the <see cref = "RequiredAttribute" /> is used if the value may not be <see langword="null"/>.
Microsoft.Extensions.Diagnostics.Probes (1)
src\Shared\Data.Validation\LengthAttribute.cs (1)
86/// It is assumed the <see cref = "RequiredAttribute" /> is used if the value may not be <see langword="null"/>.
Microsoft.Extensions.Diagnostics.ResourceMonitoring (1)
src\Shared\Data.Validation\LengthAttribute.cs (1)
86/// It is assumed the <see cref = "RequiredAttribute" /> is used if the value may not be <see langword="null"/>.
Microsoft.Extensions.Http.Resilience (1)
src\Shared\Data.Validation\LengthAttribute.cs (1)
86/// It is assumed the <see cref = "RequiredAttribute" /> is used if the value may not be <see langword="null"/>.
Microsoft.Extensions.Telemetry (1)
src\Shared\Data.Validation\LengthAttribute.cs (1)
86/// It is assumed the <see cref = "RequiredAttribute" /> is used if the value may not be <see langword="null"/>.
Microsoft.Extensions.Validation (7)
TypeExtensions.cs (5)
67/// Tries to get the <see cref="RequiredAttribute"/> from the specified array of validation attributes. 70/// <param name="requiredAttribute">The found <see cref="RequiredAttribute"/> if available, otherwise null.</param> 71/// <returns><see langword="true"/> if a <see cref="RequiredAttribute"/> is found; otherwise, <see langword="false"/>.</returns> 72public static bool TryGetRequiredAttribute(this ValidationAttribute[] attributes, [NotNullWhen(true)] out RequiredAttribute? requiredAttribute) 76if (attribute is RequiredAttribute requiredAttr)
ValidatableParameterInfo.cs (1)
16private RequiredAttribute? _requiredAttribute;
ValidatablePropertyInfo.cs (1)
15private RequiredAttribute? _requiredAttribute;
Shared (1)
Data.Validation\LengthAttribute.cs (1)
86/// It is assumed the <see cref = "RequiredAttribute" /> is used if the value may not be <see langword="null"/>.
System.ComponentModel.Annotations (18)
System\ComponentModel\DataAnnotations\LengthAttribute.cs (1)
38/// It is assumed the <see cref="RequiredAttribute" /> is used if the value may not be null.
System\ComponentModel\DataAnnotations\MaxLengthAttribute.cs (1)
58/// It is assumed the <see cref="RequiredAttribute" /> is used if the value may not be null.
System\ComponentModel\DataAnnotations\MinLengthAttribute.cs (1)
40/// It is assumed the <see cref="RequiredAttribute" /> is used if the value may not be null.
System\ComponentModel\DataAnnotations\StringLengthAttribute.cs (1)
40/// It is assumed the <see cref="RequiredAttribute" /> is used if the value may not be null.
System\ComponentModel\DataAnnotations\Validator.cs (14)
28/// If there is a <see cref="RequiredAttribute" /> found on the property, it will be evaluated before all other 33/// If <paramref name="validationResults" /> is null and there isn't a <see cref="RequiredAttribute" /> failure, 77/// checks to ensure all properties marked with <see cref="RequiredAttribute" /> are set. It does not validate the 104/// checks to ensure all properties marked with <see cref="RequiredAttribute" /> are set. If 115/// For any given property, if it has a <see cref="RequiredAttribute" /> that fails validation, no other validators 164/// If there is a <see cref="RequiredAttribute" /> within the <paramref name="validationAttributes" />, it will 170/// If <paramref name="validationResults" /> is null and there isn't a <see cref="RequiredAttribute" /> failure, 302/// A <see cref="RequiredAttribute" /> within the <paramref name="validationAttributes" /> will always be evaluated 456/// ones marked with <see cref="RequiredAttribute" /> are not null. 482if (attribute is RequiredAttribute reqAttr) 540/// If a <see cref="RequiredAttribute" /> is found, it will be evaluated first, and if that fails, 548/// <see cref="RequiredAttribute" /> failure will always abort with that sole failure. 561RequiredAttribute? required = null; 564required = attribute as RequiredAttribute;
System.ComponentModel.DataAnnotations (1)
System.ComponentModel.DataAnnotations.cs (1)
28[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.ComponentModel.DataAnnotations.RequiredAttribute))]