2 writes to ModelState
Microsoft.AspNetCore.Mvc.Abstractions (2)
ActionContext.cs (2)
24ModelState = new ModelStateDictionary(); 75ModelState = modelState;
93 references to ModelState
Microsoft.AspNetCore.Mvc.Abstractions (1)
ActionContext.cs (1)
36actionContext.ModelState)
Microsoft.AspNetCore.Mvc.Core (20)
ApiBehaviorOptions.cs (1)
32/// <see cref="ActionContext.ModelState"/> is invalid is suppressed. <seealso cref="InvalidModelStateResponseFactory"/>.
ApplicationModels\InvalidModelStateFilterConvention.cs (1)
11/// to <see cref="ActionModel"/> that responds to invalid <see cref="ActionContext.ModelState"/>
ControllerBase.cs (1)
57public ModelStateDictionary ModelState => ControllerContext.ModelState;
DependencyInjection\ApiBehaviorOptionsSetup.cs (1)
32var problemDetails = problemDetailsFactory.CreateValidationProblemDetails(context.HttpContext, context.ModelState);
Infrastructure\ControllerActionInvoker.cs (1)
625var validationState = context.ModelState.ValidationState;
Infrastructure\ControllerActionInvokerProvider.cs (3)
77controllerContext.ModelState.MaxAllowedErrors = _maxModelValidationErrors; 78controllerContext.ModelState.MaxValidationDepth = _maxValidationDepth; 79controllerContext.ModelState.MaxStateDepth = _maxModelBindingRecursionDepth;
Infrastructure\ModelStateInvalidFilter.cs (2)
13/// A <see cref="IActionFilter"/> that responds to invalid <see cref="ActionContext.ModelState"/>. This filter is 76if (context.Result == null && !context.ModelState.IsValid)
ModelBinding\CompositeValueProvider.cs (1)
90actionContext.ModelState.TryAddModelException(key: string.Empty, exception);
ModelBinding\DefaultModelBindingContext.cs (1)
228ModelState = actionContext.ModelState,
ModelBinding\ModelBindingHelper.cs (1)
239var modelState = actionContext.ModelState;
ModelBinding\ParameterBinder.cs (1)
187actionContext.ModelState.TryAddModelError(modelName, message);
ModelBinding\UnsupportedContentTypeFilter.cs (2)
13/// <see cref="ActionContext.ModelState"/> and short-circuits the pipeline 37var modelState = context.ModelState;
ModelBinding\Validation\ValidationVisitor.cs (1)
48ModelState = actionContext.ModelState;
Routing\ControllerRequestDelegateFactory.cs (3)
94controllerContext.ModelState.MaxAllowedErrors = _maxModelValidationErrors; 95controllerContext.ModelState.MaxValidationDepth = _maxValidationDepth; 96controllerContext.ModelState.MaxStateDepth = _maxModelBindingRecursionDepth;
Microsoft.AspNetCore.Mvc.Razor (1)
RazorPagePropertyActivator.cs (1)
64return _rootFactory(_metadataProvider, context.ModelState);
Microsoft.AspNetCore.Mvc.RazorPages (6)
Infrastructure\PageActionInvokerProvider.cs (1)
91ViewData = cacheEntry.ViewDataFactory(_modelMetadataProvider, actionContext.ModelState),
Infrastructure\PageRequestDelegateFactory.cs (1)
105pageContext.ViewData = cacheEntry.ViewDataFactory(_modelMetadataProvider, pageContext.ModelState);
PageBase.cs (1)
62public ModelStateDictionary ModelState => PageContext?.ModelState!;
PageLoggerExtensions.cs (2)
92var validationState = context.ModelState.ValidationState; 115var validationState = context.ModelState.ValidationState;
PageModel.cs (1)
81public ModelStateDictionary ModelState => PageContext.ModelState;
Microsoft.AspNetCore.Mvc.ViewFeatures (65)
Controller.cs (1)
46_viewData = new ViewDataDictionary(new EmptyModelMetadataProvider(), ControllerContext.ModelState);
IHtmlGenerator.cs (1)
511/// <see cref="ActionContext.ModelState"/> contains an error for the <paramref name="expression"/>.
Rendering\HtmlHelperInputExtensions.cs (24)
18/// the <see cref="ActionContext.ModelState"/> entry with full name, 42/// the <see cref="ActionContext.ModelState"/> entry with full name, 72/// the <see cref="ActionContext.ModelState"/> entry with full name, 104/// the <see cref="ActionContext.ModelState"/> entry with full name, or 129/// the <see cref="ActionContext.ModelState"/> entry with full name, 152/// the <see cref="ActionContext.ModelState"/> entry with full name, 180/// the <see cref="ActionContext.ModelState"/> entry with full name, or 276/// the <see cref="ActionContext.ModelState"/> entry with full name, 308/// the <see cref="ActionContext.ModelState"/> entry with full name, 347/// the <see cref="ActionContext.ModelState"/> entry with full name, 385/// the <see cref="ActionContext.ModelState"/> entry with full name, or 416/// the <see cref="ActionContext.ModelState"/> entry with full name, 439/// the <see cref="ActionContext.ModelState"/> entry with full name, 467/// the <see cref="ActionContext.ModelState"/> entry with full name, 500/// the <see cref="ActionContext.ModelState"/> entry with full name, 535/// the <see cref="ActionContext.ModelState"/> entry with full name, or 562/// the <see cref="ActionContext.ModelState"/> entry with full name, or 594/// the <see cref="ActionContext.ModelState"/> entry with full name, 628/// the <see cref="ActionContext.ModelState"/> entry with full name, 653/// the <see cref="ActionContext.ModelState"/> entry with full name, 684/// the <see cref="ActionContext.ModelState"/> entry with full name, 712/// the <see cref="ActionContext.ModelState"/> entry with full name, 746/// the <see cref="ActionContext.ModelState"/> entry with full name, or 773/// the <see cref="ActionContext.ModelState"/> entry with full name, or
Rendering\HtmlHelperSelectExtensions.cs (11)
19/// the <see cref="ActionContext.ModelState"/> entry with full name, or 50/// the <see cref="ActionContext.ModelState"/> entry with full name, or 90/// the <see cref="ActionContext.ModelState"/> entry with full name, 124/// the <see cref="ActionContext.ModelState"/> entry with full name, 163/// the <see cref="ActionContext.ModelState"/> entry with full name, 201/// the <see cref="ActionContext.ModelState"/> entry with full name, or 236/// the <see cref="ActionContext.ModelState"/> entry with full name, or 280/// the <see cref="ActionContext.ModelState"/> entry with full name, or 319/// the <see cref="ActionContext.ModelState"/> entry with full name, or 349/// the <see cref="ActionContext.ModelState"/> entry with full name, 383/// the <see cref="ActionContext.ModelState"/> entry with full name, or
Rendering\HtmlHelperValueExtensions.cs (4)
16/// the <see cref="ActionContext.ModelState"/> entry with full name, 37/// the <see cref="ActionContext.ModelState"/> entry with full name, or 62/// the <see cref="ActionContext.ModelState"/> entry with full name, 82/// the <see cref="ActionContext.ModelState"/> entry with full name,
Rendering\IHtmlHelper.cs (10)
172/// the <see cref="ActionContext.ModelState"/> entry with full name, 176/// the <see cref="ActionContext.ModelState"/> entry with full name, or 256/// the <see cref="ActionContext.ModelState"/> entry with full name, 402/// the <see cref="ActionContext.ModelState"/> entry with full name, 447/// the <see cref="ActionContext.ModelState"/> entry with full name, 521/// the <see cref="ActionContext.ModelState"/> entry with full name, 525/// the <see cref="ActionContext.ModelState"/> entry with full name, or 613/// the <see cref="ActionContext.ModelState"/> entry with full name, 638/// the <see cref="ActionContext.ModelState"/> entry with full name, 718/// the <see cref="ActionContext.ModelState"/> entry with full name,
Rendering\IHtmlHelperOfT.cs (10)
26/// the <see cref="ActionContext.ModelState"/> entry with full name. 29/// the <see cref="ActionContext.ModelState"/> entry with full name, or 118/// the <see cref="ActionContext.ModelState"/> entry with full name, or 191/// the <see cref="ActionContext.ModelState"/> entry with full name or 240/// the <see cref="ActionContext.ModelState"/> entry with full name, or 305/// the <see cref="ActionContext.ModelState"/> entry with full name. 308/// the <see cref="ActionContext.ModelState"/> entry with full name, or 340/// the <see cref="ActionContext.ModelState"/> entry with full name, or 367/// the <see cref="ActionContext.ModelState"/> entry with full name, 425/// the <see cref="ActionContext.ModelState"/> entry with full name, or
Rendering\ViewContext.cs (1)
34ViewData = new ViewDataDictionary(new EmptyModelMetadataProvider(), ModelState);
ViewComponentResultExecutor.cs (1)
77viewData = new ViewDataDictionary(_modelMetadataProvider, context.ModelState);
ViewDataDictionaryControllerPropertyActivator.cs (1)
92context.ModelState);
ViewExecutor.cs (1)
149viewData = new ViewDataDictionary(ModelMetadataProvider, actionContext.ModelState);