4 instantiations of ModelStateDictionary
Microsoft.AspNetCore.Mvc.Abstractions (2)
ActionContext.cs (2)
24
ModelState = 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>
65
ModelStateDictionary
modelState)
95
/// Gets the <see cref="
ModelStateDictionary
"/>.
97
public
ModelStateDictionary
ModelState { get; } = default!;
Formatters\InputFormatterContext.cs (6)
23
/// The <see cref="
ModelStateDictionary
"/> for recording errors.
34
ModelStateDictionary
modelState,
49
/// The <see cref="
ModelStateDictionary
"/> for recording errors.
63
ModelStateDictionary
modelState,
103
/// Gets the <see cref="
ModelStateDictionary
"/> associated with the current operation.
105
public
ModelStateDictionary
ModelState { get; }
ModelBinding\ModelBindingContext.cs (2)
76
/// Gets or sets the <see cref="
ModelStateDictionary
"/> used to capture <see cref="ModelStateEntry"/> values
82
public 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>
75
public 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>
445
public 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
974
private readonly
ModelStateDictionary
_dictionary;
980
/// <param name="dictionary">The <see cref="
ModelStateDictionary
"/>.</param>
982
public PrefixEnumerable(
ModelStateDictionary
dictionary, string prefix)
1014
/// <param name="dictionary">The <see cref="
ModelStateDictionary
"/>.</param>
1016
public Enumerator(
ModelStateDictionary
dictionary, string prefix)
1110
/// A <see cref="IEnumerable{T}"/> for keys in <see cref="
ModelStateDictionary
"/>.
1114
private readonly
ModelStateDictionary
_dictionary;
1119
/// <param name="dictionary">The <see cref="
ModelStateDictionary
"/>.</param>
1120
public KeyEnumerable(
ModelStateDictionary
dictionary)
1134
/// An <see cref="IEnumerator{T}"/> for keys in <see cref="
ModelStateDictionary
"/>.
1143
/// <param name="dictionary">The <see cref="
ModelStateDictionary
"/>.</param>
1145
public KeyEnumerator(
ModelStateDictionary
dictionary, string prefix)
1189
private readonly
ModelStateDictionary
_dictionary;
1194
/// <param name="dictionary">The <see cref="
ModelStateDictionary
"/>.</param>
1195
public ValueEnumerable(
ModelStateDictionary
dictionary)
1218
/// <param name="dictionary">The <see cref="
ModelStateDictionary
"/>.</param>
1220
public ValueEnumerator(
ModelStateDictionary
dictionary, string prefix)
1259
private sealed class ModelStateDictionaryDebugView(
ModelStateDictionary
dictionary)
1261
private 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>
32
public BadRequestObjectResult([ActionResultObjectValue]
ModelStateDictionary
modelState)
ConflictObjectResult.cs (2)
31
/// <param name="modelState"><see cref="
ModelStateDictionary
"/> containing the validation errors.</param>
32
public 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.
57
public
ModelStateDictionary
ModelState => ControllerContext.ModelState;
1762
/// <param name="modelState">The <see cref="
ModelStateDictionary
" /> containing errors to be returned to the client.</param>
1765
public virtual BadRequestObjectResult BadRequest([ActionResultObjectValue]
ModelStateDictionary
modelState)
1792
/// <param name="modelState">The <see cref="
ModelStateDictionary
" /> containing errors to be returned to the client.</param>
1795
public virtual UnprocessableEntityObjectResult UnprocessableEntity([ActionResultObjectValue]
ModelStateDictionary
modelState)
1822
/// <param name="modelState">The <see cref="
ModelStateDictionary
" /> containing errors to be returned to the client.</param>
1825
public virtual ConflictObjectResult Conflict([ActionResultObjectValue]
ModelStateDictionary
modelState)
1921
/// <param name="modelStateDictionary">The <see cref="
ModelStateDictionary
"/>.</param>
1925
public 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)
65
ModelStateDictionary
modelStateDictionary,
Infrastructure\ProblemDetailsFactory.cs (2)
36
/// <param name="modelStateDictionary">The <see cref="
ModelStateDictionary
" />.</param>
45
ModelStateDictionary
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)
726
var
modelState = bindingContext.ModelState;
ModelBinding\Binders\ComplexTypeModelBinder.cs (2)
62
/// adds a <see cref="
ModelStateDictionary
"/> error when the model is not bound.
564
var
modelState = bindingContext.ModelState;
ModelBinding\Binders\DateTimeModelBinder.cs (1)
50
var
modelState = bindingContext.ModelState;
ModelBinding\Binders\DecimalModelBinder.cs (1)
52
var
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)
52
var
modelState = bindingContext.ModelState;
ModelBinding\Binders\FloatModelBinder.cs (1)
52
var
modelState = bindingContext.ModelState;
ModelBinding\DefaultModelBindingContext.cs (2)
22
private
ModelStateDictionary
_modelState = default!;
81
public override
ModelStateDictionary
ModelState
ModelBinding\ElementalValueProvider.cs (1)
27
return
ModelStateDictionary
.StartsWithPrefix(prefix, Key);
ModelBinding\ModelBindingHelper.cs (7)
239
var
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>
366
ModelStateDictionary
modelState,
378
/// Clears <see cref="
ModelStateDictionary
"/> entries for <see cref="ModelMetadata"/>.
381
/// <param name="modelState">The <see cref="
ModelStateDictionary
"/> associated with the model.</param>
385
ModelStateDictionary
modelState,
ModelBinding\UnsupportedContentTypeFilter.cs (1)
37
var
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)
75
protected
ModelStateDictionary
ModelState { get; }
MvcOptions.cs (2)
30
private 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>
28
public SerializableError(
ModelStateDictionary
modelState)
UnprocessableEntityObjectResult.cs (2)
21
/// <param name="modelState"><see cref="
ModelStateDictionary
"/> containing the validation errors.</param>
22
public UnprocessableEntityObjectResult([ActionResultObjectValue]
ModelStateDictionary
modelState)
ValidationProblemDetails.cs (3)
27
/// <param name="modelState"><see cref="
ModelStateDictionary
"/> containing the validation errors.</param>
28
public ValidationProblemDetails(
ModelStateDictionary
modelState)
33
private static IDictionary<string, string[]> CreateErrorDictionary(
ModelStateDictionary
modelState)
Microsoft.AspNetCore.Mvc.Razor (1)
RazorPagePropertyActivator.cs (1)
19
private readonly Func<IModelMetadataProvider,
ModelStateDictionary
, ViewDataDictionary> _rootFactory;
Microsoft.AspNetCore.Mvc.RazorPages (10)
Infrastructure\PageActionInvokerCacheEntry.cs (2)
16
Func<IModelMetadataProvider,
ModelStateDictionary
, ViewDataDictionary> viewDataFactory,
66
public Func<IModelMetadataProvider,
ModelStateDictionary
, ViewDataDictionary> ViewDataFactory { get; }
PageBase.cs (4)
60
/// Gets the <see cref="
ModelStateDictionary
"/>.
62
public
ModelStateDictionary
ModelState => PageContext?.ModelState!;
141
/// <param name="modelState">The <see cref="
ModelStateDictionary
" /> containing errors to be returned to the client.</param>
143
public virtual BadRequestObjectResult BadRequest(
ModelStateDictionary
modelState)
PageModel.cs (4)
79
/// Gets the <see cref="
ModelStateDictionary
"/>.
81
public
ModelStateDictionary
ModelState => PageContext.ModelState;
473
/// <param name="modelState">The <see cref="
ModelStateDictionary
" /> containing errors to be returned to the client.</param>
475
public 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>
26
this
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>
53
this
ModelStateDictionary
modelState,
70
/// <param name="modelState">The <see cref="
ModelStateDictionary
"/> instance this method extends.</param>
75
this
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>
98
this
ModelStateDictionary
modelState,
109
/// <see cref="
ModelStateDictionary
"/>.
112
/// <param name="modelState">The <see cref="
ModelStateDictionary
"/> instance this method extends.</param>
115
this
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)
60
var
modelStateDictionary = viewData.ModelState;
ViewComponent.cs (2)
73
/// Gets the <see cref="
ModelStateDictionary
"/>.
75
public
ModelStateDictionary
ModelState => ViewData?.ModelState!;
ViewDataDictionary.cs (7)
34
/// <param name="modelState"><see cref="
ModelStateDictionary
"/> instance for this scope.</param>
38
ModelStateDictionary
modelState)
104
/// <param name="modelState"><see cref="
ModelStateDictionary
"/> instance for this scope.</param>
114
ModelStateDictionary
modelState,
244
ModelStateDictionary
modelState,
273
/// Gets the <see cref="
ModelStateDictionary
"/>.
275
public
ModelStateDictionary
ModelState { get; }
ViewDataDictionaryFactory.cs (4)
12
public static Func<IModelMetadataProvider,
ModelStateDictionary
, ViewDataDictionary> CreateFactory(Type modelType)
17
var constructor = type.GetConstructor(new[] { typeof(IModelMetadataProvider), typeof(
ModelStateDictionary
) });
21
var parameter2 = Expression.Parameter(typeof(
ModelStateDictionary
), "modelState");
24
Expression.Lambda<Func<IModelMetadataProvider,
ModelStateDictionary
, ViewDataDictionary>>(
ViewDataDictionaryOfT.cs (1)
26
ModelStateDictionary
modelState)