4 instantiations of ModelStateDictionary
Microsoft.AspNetCore.Mvc.Abstractions (2)
ActionContext.cs (2)
24ModelState = new ModelStateDictionary(); 50: this(httpContext, routeData, actionDescriptor, new ModelStateDictionary())
Microsoft.AspNetCore.Mvc.ViewFeatures (2)
ViewDataDictionary.cs (2)
73: this(metadataProvider, new ModelStateDictionary()) 93: this(metadataProvider, new ModelStateDictionary(), declaredModelType)
189 references to ModelStateDictionary
Microsoft.AspNetCore.Mvc.Abstractions (56)
ActionContext.cs (4)
60/// <param name="modelState">The <see cref="ModelStateDictionary"/>.</param> 65ModelStateDictionary modelState) 95/// Gets the <see cref="ModelStateDictionary"/>. 97public ModelStateDictionary ModelState { get; } = default!;
Formatters\InputFormatterContext.cs (6)
23/// The <see cref="ModelStateDictionary"/> for recording errors. 34ModelStateDictionary modelState, 49/// The <see cref="ModelStateDictionary"/> for recording errors. 63ModelStateDictionary modelState, 103/// Gets the <see cref="ModelStateDictionary"/> associated with the current operation. 105public ModelStateDictionary ModelState { get; }
ModelBinding\ModelBindingContext.cs (2)
76/// Gets or sets the <see cref="ModelStateDictionary"/> used to capture <see cref="ModelStateEntry"/> values 82public abstract ModelStateDictionary ModelState { get; set; }
ModelBinding\ModelStateDictionary.cs (38)
40/// Initializes a new instance of the <see cref="ModelStateDictionary"/> class. 48/// Initializes a new instance of the <see cref="ModelStateDictionary"/> class. 56/// Initializes a new instance of the <see cref="ModelStateDictionary"/> class. 71/// Initializes a new instance of the <see cref="ModelStateDictionary"/> class by using values that are copied 74/// <param name="dictionary">The <see cref="ModelStateDictionary"/> to copy values from.</param> 75public ModelStateDictionary(ModelStateDictionary dictionary) 86/// Root entry for the <see cref="ModelStateDictionary"/>. 91/// Gets or sets the maximum allowed model state errors in this instance of <see cref="ModelStateDictionary"/>. 96/// <see cref="ModelStateDictionary"/> tracks the number of model errors added by calls to 131/// Gets the number of errors added to this instance of <see cref="ModelStateDictionary"/> via 196/// This method allows adding the <paramref name="exception"/> to the current <see cref="ModelStateDictionary"/> 444/// <param name="dictionary">The <see cref="ModelStateDictionary"/> to copy values from.</param> 445public void Merge(ModelStateDictionary dictionary) 512/// Clears <see cref="ModelStateDictionary"/> entries that match the key that is passed as parameter. 514/// <param name="key">The key of <see cref="ModelStateDictionary"/> to clear.</param> 689/// Removes all keys and values from this instance of <see cref="ModelStateDictionary"/>. 747/// Returns an enumerator that iterates through this instance of <see cref="ModelStateDictionary"/>. 802/// Gets a <see cref="PrefixEnumerable"/> that iterates over this instance of <see cref="ModelStateDictionary"/> 969/// Enumerates over <see cref="ModelStateDictionary"/> to provide entries that start with the 974private readonly ModelStateDictionary _dictionary; 980/// <param name="dictionary">The <see cref="ModelStateDictionary"/>.</param> 982public PrefixEnumerable(ModelStateDictionary dictionary, string prefix) 1014/// <param name="dictionary">The <see cref="ModelStateDictionary"/>.</param> 1016public Enumerator(ModelStateDictionary dictionary, string prefix) 1110/// A <see cref="IEnumerable{T}"/> for keys in <see cref="ModelStateDictionary"/>. 1114private readonly ModelStateDictionary _dictionary; 1119/// <param name="dictionary">The <see cref="ModelStateDictionary"/>.</param> 1120public KeyEnumerable(ModelStateDictionary dictionary) 1134/// An <see cref="IEnumerator{T}"/> for keys in <see cref="ModelStateDictionary"/>. 1143/// <param name="dictionary">The <see cref="ModelStateDictionary"/>.</param> 1145public KeyEnumerator(ModelStateDictionary dictionary, string prefix) 1189private readonly ModelStateDictionary _dictionary; 1194/// <param name="dictionary">The <see cref="ModelStateDictionary"/>.</param> 1195public ValueEnumerable(ModelStateDictionary dictionary) 1218/// <param name="dictionary">The <see cref="ModelStateDictionary"/>.</param> 1220public ValueEnumerator(ModelStateDictionary dictionary, string prefix) 1259private sealed class ModelStateDictionaryDebugView(ModelStateDictionary dictionary) 1261private readonly ModelStateDictionary _dictionary = dictionary;
ModelBinding\ModelStateEntry.cs (2)
7/// An entry in a <see cref="ModelStateDictionary"/>. 46/// <see cref="ModelStateDictionary"/>.
ModelBinding\ModelValidationState.cs (4)
9/// <see cref="ModelValidationState"/> of <see cref="ModelStateDictionary.Root"/> is used to determine the validity 10/// of <see cref="ModelStateDictionary"/>. <see cref="ModelStateDictionary.IsValid"/> is <see langword="true" />, when 11/// the aggregate validity (<see cref="ModelStateDictionary.GetFieldValidationState(string)"/>)
Microsoft.AspNetCore.Mvc.Core (60)
ApiBehaviorOptions.cs (1)
22/// <see cref="ModelStateDictionary"/> into an <see cref="IActionResult"/>
BadRequestObjectResult.cs (2)
31/// <param name="modelState"><see cref="ModelStateDictionary"/> containing the validation errors.</param> 32public BadRequestObjectResult([ActionResultObjectValue] ModelStateDictionary modelState)
ConflictObjectResult.cs (2)
31/// <param name="modelState"><see cref="ModelStateDictionary"/> containing the validation errors.</param> 32public ConflictObjectResult([ActionResultObjectValue] ModelStateDictionary modelState)
ControllerBase.cs (14)
55/// Gets the <see cref="ModelStateDictionary"/> that contains the state of the model and of model-binding validation. 57public ModelStateDictionary ModelState => ControllerContext.ModelState; 1762/// <param name="modelState">The <see cref="ModelStateDictionary" /> containing errors to be returned to the client.</param> 1765public virtual BadRequestObjectResult BadRequest([ActionResultObjectValue] ModelStateDictionary modelState) 1792/// <param name="modelState">The <see cref="ModelStateDictionary" /> containing errors to be returned to the client.</param> 1795public virtual UnprocessableEntityObjectResult UnprocessableEntity([ActionResultObjectValue] ModelStateDictionary modelState) 1822/// <param name="modelState">The <see cref="ModelStateDictionary" /> containing errors to be returned to the client.</param> 1825public virtual ConflictObjectResult Conflict([ActionResultObjectValue] ModelStateDictionary modelState) 1921/// <param name="modelStateDictionary">The <see cref="ModelStateDictionary"/>.</param> 1925public virtual ActionResult ValidationProblem([ActionResultObjectValue] ModelStateDictionary modelStateDictionary) 1947/// <param name="modelStateDictionary">The <see cref="ModelStateDictionary"/>. 1959[ActionResultObjectValue] ModelStateDictionary? modelStateDictionary) 1971/// <param name="modelStateDictionary">The <see cref="ModelStateDictionary"/>. 1983[ActionResultObjectValue] ModelStateDictionary? modelStateDictionary = null,
Infrastructure\DefaultProblemDetailsFactory.cs (1)
65ModelStateDictionary modelStateDictionary,
Infrastructure\ProblemDetailsFactory.cs (2)
36/// <param name="modelStateDictionary">The <see cref="ModelStateDictionary" />.</param> 45ModelStateDictionary modelStateDictionary,
JsonOptions.cs (2)
18/// <see cref="SystemTextJsonInputFormatter"/> will be added to the <see cref="ModelStateDictionary"/>. If 25/// Error messages in the <see cref="ModelStateDictionary"/> are often communicated to clients, either in HTML
ModelBinding\Binders\ArrayModelBinder.cs (2)
40/// adds a <see cref="ModelStateDictionary"/> error when the model is not bound. 65/// adds a <see cref="ModelStateDictionary"/> error when the model is not bound.
ModelBinding\Binders\CollectionModelBinder.cs (2)
50/// adds a <see cref="ModelStateDictionary"/> error when the model is not bound. 75/// adds a <see cref="ModelStateDictionary"/> error when the model is not bound.
ModelBinding\Binders\ComplexObjectModelBinder.cs (1)
726var modelState = bindingContext.ModelState;
ModelBinding\Binders\ComplexTypeModelBinder.cs (2)
62/// adds a <see cref="ModelStateDictionary"/> error when the model is not bound. 564var modelState = bindingContext.ModelState;
ModelBinding\Binders\DateTimeModelBinder.cs (1)
50var modelState = bindingContext.ModelState;
ModelBinding\Binders\DecimalModelBinder.cs (1)
52var modelState = bindingContext.ModelState;
ModelBinding\Binders\DictionaryModelBinder.cs (2)
45/// adds a <see cref="ModelStateDictionary"/> error when the model is not bound. 79/// adds a <see cref="ModelStateDictionary"/> error when the model is not bound.
ModelBinding\Binders\DoubleModelBinder.cs (1)
52var modelState = bindingContext.ModelState;
ModelBinding\Binders\FloatModelBinder.cs (1)
52var modelState = bindingContext.ModelState;
ModelBinding\DefaultModelBindingContext.cs (2)
22private ModelStateDictionary _modelState = default!; 81public override ModelStateDictionary ModelState
ModelBinding\ElementalValueProvider.cs (1)
27return ModelStateDictionary.StartsWithPrefix(prefix, Key);
ModelBinding\ModelBindingHelper.cs (7)
239var modelState = actionContext.ModelState; 358/// Clears <see cref="ModelStateDictionary"/> entries for <see cref="ModelMetadata"/>. 361/// <param name="modelState">The <see cref="ModelStateDictionary"/> associated with the model.</param> 366ModelStateDictionary modelState, 378/// Clears <see cref="ModelStateDictionary"/> entries for <see cref="ModelMetadata"/>. 381/// <param name="modelState">The <see cref="ModelStateDictionary"/> associated with the model.</param> 385ModelStateDictionary modelState,
ModelBinding\UnsupportedContentTypeFilter.cs (1)
37var modelState = context.ModelState;
ModelBinding\Validation\ShortFormDictionaryValidationStrategy.cs (2)
38/// The mapping from <see cref="ModelStateDictionary"/> key to dictionary key. 52/// Gets the mapping from <see cref="ModelStateDictionary"/> key to dictionary key.
ModelBinding\Validation\ValidationVisitor.cs (1)
75protected ModelStateDictionary ModelState { get; }
MvcOptions.cs (2)
30private int _maxModelStateErrors = ModelStateDictionary.DefaultMaxAllowedErrors; 71/// <see cref="ModelStateDictionary"/> if the incoming request body is empty.
SerializableError.cs (2)
27/// <param name="modelState"><see cref="ModelStateDictionary"/> containing the validation errors.</param> 28public SerializableError(ModelStateDictionary modelState)
UnprocessableEntityObjectResult.cs (2)
21/// <param name="modelState"><see cref="ModelStateDictionary"/> containing the validation errors.</param> 22public UnprocessableEntityObjectResult([ActionResultObjectValue] ModelStateDictionary modelState)
ValidationProblemDetails.cs (3)
27/// <param name="modelState"><see cref="ModelStateDictionary"/> containing the validation errors.</param> 28public ValidationProblemDetails(ModelStateDictionary modelState) 33private static IDictionary<string, string[]> CreateErrorDictionary(ModelStateDictionary modelState)
Microsoft.AspNetCore.Mvc.Razor (1)
RazorPagePropertyActivator.cs (1)
19private readonly Func<IModelMetadataProvider, ModelStateDictionary, ViewDataDictionary> _rootFactory;
Microsoft.AspNetCore.Mvc.RazorPages (10)
Infrastructure\PageActionInvokerCacheEntry.cs (2)
16Func<IModelMetadataProvider, ModelStateDictionary, ViewDataDictionary> viewDataFactory, 66public Func<IModelMetadataProvider, ModelStateDictionary, ViewDataDictionary> ViewDataFactory { get; }
PageBase.cs (4)
60/// Gets the <see cref="ModelStateDictionary"/>. 62public ModelStateDictionary ModelState => PageContext?.ModelState!; 141/// <param name="modelState">The <see cref="ModelStateDictionary" /> containing errors to be returned to the client.</param> 143public virtual BadRequestObjectResult BadRequest(ModelStateDictionary modelState)
PageModel.cs (4)
79/// Gets the <see cref="ModelStateDictionary"/>. 81public ModelStateDictionary ModelState => PageContext.ModelState; 473/// <param name="modelState">The <see cref="ModelStateDictionary" /> containing errors to be returned to the client.</param> 475public virtual BadRequestObjectResult BadRequest(ModelStateDictionary modelState)
Microsoft.AspNetCore.Mvc.ViewFeatures (62)
IHtmlGenerator.cs (1)
518/// <see cref="ModelBinding.ModelStateDictionary"/> object. Message will always be visible but client-side
ModelStateDictionaryExtensions.cs (14)
11/// Extensions methods for <see cref="ModelStateDictionary"/>. 22/// <param name="modelState">The <see cref="ModelStateDictionary"/> instance this method extends.</param> 26this ModelStateDictionary modelState, 44/// This method allows adding the <paramref name="exception"/> to the current <see cref="ModelStateDictionary"/> 49/// <param name="modelState">The <see cref="ModelStateDictionary"/> instance this method extends.</param> 53this ModelStateDictionary modelState, 70/// <param name="modelState">The <see cref="ModelStateDictionary"/> instance this method extends.</param> 75this ModelStateDictionary modelState, 88/// Removes the specified <paramref name="expression"/> from the <see cref="ModelStateDictionary"/>. 91/// <param name="modelState">The <see cref="ModelStateDictionary"/> instance this method extends.</param> 98this ModelStateDictionary modelState, 109/// <see cref="ModelStateDictionary"/>. 112/// <param name="modelState">The <see cref="ModelStateDictionary"/> instance this method extends.</param> 115this ModelStateDictionary modelState,
Rendering\HtmlHelperValidationExtensions.cs (27)
15/// Returns the validation message if an error exists in the <see cref="ModelBinding.ModelStateDictionary"/> 26/// Method extracts an error string from the <see cref="ModelBinding.ModelStateDictionary"/> object. Message 39/// Returns the validation message if an error exists in the <see cref="ModelBinding.ModelStateDictionary"/> 46/// <see cref="ModelBinding.ModelStateDictionary"/> object. Message will always be visible but client-side 65/// Returns the validation message if an error exists in the <see cref="ModelBinding.ModelStateDictionary"/> 82/// Method extracts an error string from the <see cref="ModelBinding.ModelStateDictionary"/> object. Message 96/// Returns the validation message if an error exists in the <see cref="ModelBinding.ModelStateDictionary"/> 103/// <see cref="ModelBinding.ModelStateDictionary"/> object. Message will always be visible but client-side 127/// Returns the validation message if an error exists in the <see cref="ModelBinding.ModelStateDictionary"/> 134/// <see cref="ModelBinding.ModelStateDictionary"/> object. Message will always be visible but client-side 160/// Returns the validation message if an error exists in the <see cref="ModelBinding.ModelStateDictionary"/> 173/// Method extracts an error string from the <see cref="ModelBinding.ModelStateDictionary"/> object. Message 187/// Returns the validation message if an error exists in the <see cref="ModelBinding.ModelStateDictionary"/> 194/// <see cref="ModelBinding.ModelStateDictionary"/> object. Message will always be visible but client-side 216/// Returns the validation message if an error exists in the <see cref="ModelBinding.ModelStateDictionary"/> 223/// <see cref="ModelBinding.ModelStateDictionary"/> object. Message will always be visible but client-side 252/// Returns the validation message if an error exists in the <see cref="ModelBinding.ModelStateDictionary"/> 259/// <see cref="ModelBinding.ModelStateDictionary"/> object. Message will always be visible but client-side 287/// <see cref="ModelBinding.ModelStateDictionary"/> object. 307/// <see cref="ModelBinding.ModelStateDictionary"/> object. 330/// <see cref="ModelBinding.ModelStateDictionary"/> object. 353/// <see cref="ModelBinding.ModelStateDictionary"/> object. 379/// <see cref="ModelBinding.ModelStateDictionary"/> object. 408/// <see cref="ModelBinding.ModelStateDictionary"/> object. 439/// <see cref="ModelBinding.ModelStateDictionary"/> object. 474/// <see cref="ModelBinding.ModelStateDictionary"/> object. 507/// <see cref="ModelBinding.ModelStateDictionary"/> object.
Rendering\IHtmlHelper.cs (3)
664/// Returns the validation message if an error exists in the <see cref="ModelStateDictionary"/> object 670/// <see cref="ModelStateDictionary"/> object. Message will always be visible but client-side validation may 690/// <see cref="ModelStateDictionary"/> object.
Rendering\IHtmlHelperOfT.cs (2)
394/// Returns the validation message if an error exists in the <see cref="ModelBinding.ModelStateDictionary"/> 400/// <see cref="ModelBinding.ModelStateDictionary"/> object. Message will always be visible but client-side
ValidationHelpers.cs (1)
60var modelStateDictionary = viewData.ModelState;
ViewComponent.cs (2)
73/// Gets the <see cref="ModelStateDictionary"/>. 75public ModelStateDictionary ModelState => ViewData?.ModelState!;
ViewDataDictionary.cs (7)
34/// <param name="modelState"><see cref="ModelStateDictionary"/> instance for this scope.</param> 38ModelStateDictionary modelState) 104/// <param name="modelState"><see cref="ModelStateDictionary"/> instance for this scope.</param> 114ModelStateDictionary modelState, 244ModelStateDictionary modelState, 273/// Gets the <see cref="ModelStateDictionary"/>. 275public ModelStateDictionary ModelState { get; }
ViewDataDictionaryFactory.cs (4)
12public static Func<IModelMetadataProvider, ModelStateDictionary, ViewDataDictionary> CreateFactory(Type modelType) 17var constructor = type.GetConstructor(new[] { typeof(IModelMetadataProvider), typeof(ModelStateDictionary) }); 21var parameter2 = Expression.Parameter(typeof(ModelStateDictionary), "modelState"); 24Expression.Lambda<Func<IModelMetadataProvider, ModelStateDictionary, ViewDataDictionary>>(
ViewDataDictionaryOfT.cs (1)
26ModelStateDictionary modelState)