1 type derived from ModelStateEntry
Microsoft.AspNetCore.Mvc.Abstractions (1)
ModelBinding\ModelStateDictionary.cs (1)
828
private sealed class ModelStateNode :
ModelStateEntry
393 references to ModelStateEntry
Microsoft.AspNetCore.Mvc.Abstractions (69)
ModelBinding\ModelBindingContext.cs (1)
76
/// Gets or sets the <see cref="ModelStateDictionary"/> used to capture <see cref="
ModelStateEntry
"/> values
ModelBinding\ModelStateDictionary.cs (54)
22
public class ModelStateDictionary : IReadOnlyDictionary<string,
ModelStateEntry
?>
88
public
ModelStateEntry
Root => _root;
103
/// Errors added via modifying <see cref="
ModelStateEntry
"/> directly do not count towards this limit.
145
IEnumerable<string> IReadOnlyDictionary<string,
ModelStateEntry
?>.Keys => Keys;
153
IEnumerable<
ModelStateEntry
> IReadOnlyDictionary<string,
ModelStateEntry
?>.Values => Values;
171
public
ModelStateEntry
? this[string key]
177
TryGetValue(key, out
var
entry);
190
/// Adds the specified <paramref name="exception"/> to the <see cref="
ModelStateEntry
.Errors"/> instance
201
/// <param name="key">The key of the <see cref="
ModelStateEntry
"/> to add errors to.</param>
230
/// Adds the specified <paramref name="exception"/> to the <see cref="
ModelStateEntry
.Errors"/> instance
235
/// <param name="key">The key of the <see cref="
ModelStateEntry
"/> to add errors to.</param>
249
/// Attempts to add the specified <paramref name="exception"/> to the <see cref="
ModelStateEntry
.Errors"/>
254
/// <param name="key">The key of the <see cref="
ModelStateEntry
"/> to add errors to.</param>
277
TryGetValue(key, out
var
entry);
317
/// Adds the specified <paramref name="errorMessage"/> to the <see cref="
ModelStateEntry
.Errors"/> instance
322
/// <param name="key">The key of the <see cref="
ModelStateEntry
"/> to add errors to.</param>
333
/// Attempts to add the specified <paramref name="errorMessage"/> to the <see cref="
ModelStateEntry
.Errors"/>
338
/// <param name="key">The key of the <see cref="
ModelStateEntry
"/> to add errors to.</param>
392
if (TryGetValue(key, out
var
validationState))
401
/// Marks the <see cref="
ModelStateEntry
.ValidationState"/> for the entry with the specified
404
/// <param name="key">The key of the <see cref="
ModelStateEntry
"/> to mark as valid.</param>
421
/// Marks the <see cref="
ModelStateEntry
.ValidationState"/> for the entry with the specified <paramref name="key"/>
424
/// <param name="key">The key of the <see cref="
ModelStateEntry
"/> to mark as skipped.</param>
463
/// Sets the of <see cref="
ModelStateEntry
.RawValue"/> and <see cref="
ModelStateEntry
.AttemptedValue"/> for
464
/// the <see cref="
ModelStateEntry
"/> with the specified <paramref name="key"/>.
466
/// <param name="key">The key for the <see cref="
ModelStateEntry
"/> entry.</param>
467
/// <param name="rawValue">The raw value for the <see cref="
ModelStateEntry
"/> entry.</param>
483
/// Sets the value for the <see cref="
ModelStateEntry
"/> with the specified <paramref name="key"/>.
485
/// <param name="key">The key for the <see cref="
ModelStateEntry
"/> entry</param>
487
/// A <see cref="ValueProviderResult"/> with data for the <see cref="
ModelStateEntry
"/> entry.
709
/// Removes the <see cref="
ModelStateEntry
"/> with the specified <paramref name="key"/>.
731
public bool TryGetValue(string key, [NotNullWhen(true)] out
ModelStateEntry
? value)
753
IEnumerator<KeyValuePair<string,
ModelStateEntry
?>>
754
IEnumerable<KeyValuePair<string,
ModelStateEntry
?>>.GetEnumerator() => GetEnumerator();
839
public override IReadOnlyList<
ModelStateEntry
>? Children => ChildNodes;
852
public void Copy(
ModelStateEntry
entry)
925
public override
ModelStateEntry
? GetModelStateForProperty(string propertyName)
972
public readonly struct PrefixEnumerable : IEnumerable<KeyValuePair<string,
ModelStateEntry
>>
994
IEnumerator<KeyValuePair<string,
ModelStateEntry
>>
995
IEnumerable<KeyValuePair<string,
ModelStateEntry
>>.GetEnumerator() => GetEnumerator();
1003
public struct Enumerator : IEnumerator<KeyValuePair<string,
ModelStateEntry
>>
1029
public KeyValuePair<string,
ModelStateEntry
> Current =>
1030
new KeyValuePair<string,
ModelStateEntry
>(_modelStateNode.Key, _modelStateNode);
1185
/// An <see cref="IEnumerable"/> for <see cref="
ModelStateEntry
"/>.
1187
public readonly struct ValueEnumerable : IEnumerable<
ModelStateEntry
>
1203
IEnumerator<
ModelStateEntry
> IEnumerable<
ModelStateEntry
>.GetEnumerator() => GetEnumerator();
1209
/// An enumerator for <see cref="
ModelStateEntry
"/>.
1211
public struct ValueEnumerator : IEnumerator<
ModelStateEntry
>
1227
public
ModelStateEntry
Current { get; private set; }
1264
public DictionaryItemDebugView<string,
ModelStateEntry
?>[] Items => _dictionary.Select(pair => new DictionaryItemDebugView<string,
ModelStateEntry
?>(pair)).ToArray();
ModelBinding\ModelStateEntry.cs (6)
44
/// Gets a value that determines if the current instance of <see cref="
ModelStateEntry
"/> is a container node.
51
/// Gets the <see cref="
ModelStateEntry
"/> for a sub-property with the specified
56
/// The <see cref="
ModelStateEntry
"/> if a sub-property was found; otherwise <see langword="null"/>.
62
public abstract
ModelStateEntry
? GetModelStateForProperty(string propertyName);
65
/// Gets the <see cref="
ModelStateEntry
"/> values for sub-properties.
71
public abstract IReadOnlyList<
ModelStateEntry
>? Children { get; }
ModelBinding\ModelValidationState.cs (8)
7
/// The validation state of a <see cref="
ModelStateEntry
"/> instance.
18
/// Validation has not been performed on the <see cref="
ModelStateEntry
"/>.
20
/// For aggregate validity, the validation of a <see cref="
ModelStateEntry
"/> is <see cref="Unvalidated"/>
27
/// Validation was performed on the <see cref="
ModelStateEntry
"/> and was found to be invalid.
29
/// For aggregate validity, the validation of a <see cref="
ModelStateEntry
"/> is <see cref="Invalid"/>
36
/// Validation was performed on the <see cref="
ModelStateEntry
"/>
38
/// For aggregate validity, the validation of a <see cref="
ModelStateEntry
"/> is <see cref="Valid"/>
45
/// Validation was skipped for the <see cref="
ModelStateEntry
"/>.
Microsoft.AspNetCore.Mvc.Abstractions.Test (11)
ModelBinding\ModelStateDictionaryTest.cs (11)
75
var
result = modelStateDictionary[key];
101
var
result = modelStateDictionary[key];
266
var
entry = source["key"];
278
var
actual = target["key"];
566
var
item = dictionary1["foo"];
598
var
item = dictionary1["other-key"];
636
var
modelState = dictionary["some key"];
656
var
modelState = dictionary["some key"];
1576
var
property1 = modelStateDictionary.Root.GetModelStateForProperty("property1");
1577
var
property2 = modelStateDictionary.Root.GetModelStateForProperty("property1.property2");
1596
var
property = modelStateDictionary.Root.GetModelStateForProperty("[property]");
Microsoft.AspNetCore.Mvc.Core (3)
ModelBinding\ModelBindingHelper.cs (1)
425
var
entry = modelState[string.Empty];
ModelBinding\Validation\ValidationVisitor.cs (2)
178
var
entry = ModelState[key];
251
var
entry = ModelState[Key];
Microsoft.AspNetCore.Mvc.Core.Test (36)
ModelBinding\Binders\ComplexObjectModelBinderTest.cs (3)
620
Assert.True(modelStateDictionary.TryGetValue("theModel.Age", out
var
entry));
685
Assert.True(modelStateDictionary.TryGetValue("theModel.Age", out
var
entry));
724
Assert.True(modelStateDictionary.TryGetValue("theModel.Age", out
var
entry));
ModelBinding\Binders\ComplexTypeModelBinderTest.cs (3)
798
Assert.True(modelStateDictionary.TryGetValue("theModel.Age", out
var
entry));
832
Assert.True(modelStateDictionary.TryGetValue("theModel.Age", out
var
entry));
868
Assert.True(modelStateDictionary.TryGetValue("theModel.Age", out
var
entry));
ModelBinding\Binders\HeaderModelBinderTests.cs (2)
292
var
entry = bindingContext.ModelState["someprefix.Header"];
316
var
entry = bindingContext.ModelState["someprefix.Header"];
ModelBinding\Binders\KeyValuePairModelBinderTest.cs (1)
56
var
state = bindingContext.ModelState["someName.Value"];
ModelBinding\Validation\DefaultObjectValidatorTests.cs (27)
42
var
entry = modelState["parameter"];
69
var
entry = modelState["parameter"];
98
var
entry = modelState["parameter"];
125
var
entry = modelState["parameter"];
175
var
entry = modelState["parameter.Reference"];
207
var
entry = modelState["parameter.Reference"];
237
var
entry = modelState["Name"];
280
var
entry = modelState["person.Name"];
312
var
entry = modelState["parameter.Street"];
344
var
entry = modelState["Street"];
376
var
entry = modelState["Name"];
489
var
entry = modelState["parameter"];
635
var
entry = modelState["parameter"];
666
var
entry = modelState["parameter.Name"];
702
var
entry = modelState["parameter.Name"];
742
var
entry = modelState[string.Empty];
772
var
entry = modelState["parameter[0]"];
803
var
entry = modelState["[0].Name"];
846
var
entry = modelState["[0].Name"];
928
var
entry = modelState["items[0]"];
1004
var
entry = modelState["items[0].Key"];
1052
var
entry = modelState["[0].Key"];
1151
var
entry = modelState["user.Password"];
1181
var
entry = modelState["userIds[0]"];
1381
var
entry = modelState["Property1"];
1411
var
entry = modelState["Property1"];
1441
var
entry = modelState["Property1"];
Microsoft.AspNetCore.Mvc.IntegrationTests (250)
ActionParametersIntegrationTest.cs (5)
114
var
state = entry.Value;
294
var
state = entry.Value;
795
var
entry = modelState[paramName];
836
var
entry = modelState[string.Empty];
881
var
entry = modelState[parameter.Name];
ArrayModelBinderIntegrationTest.cs (6)
44
var
entry = Assert.Single(modelState, kvp => kvp.Key == "parameter[0]").Value;
88
var
entry = Assert.Single(modelState, kvp => kvp.Key == "prefix[0]").Value;
128
var
entry = Assert.Single(modelState, kvp => kvp.Key == "[0]").Value;
204
var
entry = Assert.Single(modelState, kvp => kvp.Key == "parameter[0].Name").Value;
249
var
entry = Assert.Single(modelState, kvp => kvp.Key == "prefix[0].Name").Value;
290
var
entry = Assert.Single(modelState, kvp => kvp.Key == "[0].Name").Value;
BinderTypeBasedModelBinderIntegrationTest.cs (2)
183
var
entry = kvp.Value;
235
var
entry = kvp.Value;
BodyValidationIntegrationTests.cs (3)
587
var
state = modelState["CustomParameter.Address.Number"];
639
var
street = entry.Value;
736
var
street = entry.Value;
CollectionModelBinderIntegrationTest.cs (9)
50
var
entry = Assert.Single(modelState, kvp => kvp.Key == "parameter[0]").Value;
320
var
entry = Assert.Single(modelState, kvp => kvp.Key == "parameter[0].Id").Value;
379
var
entry = Assert.Single(modelState, kvp => kvp.Key == "prefix[0].Id").Value;
430
var
entry = Assert.Single(modelState, kvp => kvp.Key == "[0].Id").Value;
480
var
entry = Assert.Single(modelState, kvp => kvp.Key == "parameter[low]").Value;
525
var
entry = Assert.Single(modelState, kvp => kvp.Key == "[low].Id").Value;
620
var
entry = Assert.Single(modelState, kvp => kvp.Key == "Addresses[Key1].Street").Value;
678
var
entry = kvp.Value;
718
var
entry = Assert.Single(modelState).Value;
ComplexRecordIntegrationTest.cs (44)
76
var
entry = Assert.Single(modelState, e => e.Key == "parameter.Customer.Name").Value;
126
var
entry = Assert.Single(modelState, e => e.Key == "Customer.Name").Value;
177
var
entry = Assert.Single(modelState, e => e.Key == "parameter.Customer.Name").Value;
231
var
entry = Assert.Single(modelState, e => e.Key == "parameter.Customer.Name").Value;
280
var
entry = Assert.Single(modelState).Value;
377
var
entry = Assert.Single(modelState, e => e.Key == "parameter.Customer.Name").Value;
429
var
entry = Assert.Single(modelState, e => e.Key == "Customer.Name").Value;
481
var
entry = Assert.Single(modelState, e => e.Key == "parameter.Customer.Name").Value;
534
var
entry = Assert.Single(modelState, e => e.Key == "parameter.Customer.Name").Value;
587
var
entry = Assert.Single(modelState, e => e.Key == "Customer.Name").Value;
642
var
entry = kvp.Value;
699
var
entry = Assert.Single(modelState, e => e.Key == "parameter.ProductId").Value;
801
var
entry = Assert.Single(modelState, e => e.Key == "parameter.Name").Value;
856
var
entry = Assert.Single(modelState, e => e.Key == "Name").Value;
911
var
entry = Assert.Single(modelState, e => e.Key == "parameter.Name").Value;
1004
var
entry = Assert.Single(modelState, e => e.Key == "parameter.Name").Value;
1059
var
entry = Assert.Single(modelState, e => e.Key == "Name").Value;
1114
var
entry = Assert.Single(modelState, e => e.Key == "parameter.Name").Value;
1207
var
entry = Assert.Single(modelState, e => e.Key == "parameter.Name").Value;
1262
var
entry = Assert.Single(modelState, e => e.Key == "Name").Value;
1317
var
entry = Assert.Single(modelState, e => e.Key == "parameter.Name").Value;
1453
var
entry = Assert.Single(modelState, e => e.Key == "p.Name").Value;
1560
var
entry = Assert.Single(modelState, e => e.Key == "p.Name").Value;
1667
var
entry = Assert.Single(modelState, e => e.Key == "p.Name").Value;
1741
var
entry = Assert.Single(modelState, e => e.Key == "parameter.Name").Value;
1796
var
entry = Assert.Single(modelState, e => e.Key == "Name").Value;
1872
var
entry = Assert.Single(modelState, e => e.Key == "p.Name").Value;
1991
var
entry = Assert.Single(modelState, e => e.Key == "Customer").Value;
2047
var
entry = Assert.Single(modelState, e => e.Key == "Customer").Value;
2101
var
entry = Assert.Single(modelState, e => e.Key == "parameter.Customer.Id").Value;
2155
var
entry = Assert.Single(modelState, e => e.Key == "Customer.Id").Value;
2213
var
entry = Assert.Single(modelState, e => e.Key == "customParameter.Customer.Id").Value;
2267
var
entry = Assert.Single(modelState, e => e.Key == "ProductName").Value;
2319
var
entry = Assert.Single(modelState, e => e.Key == "customParameter.ProductName").Value;
2367
var
entry = Assert.Single(modelState, e => e.Key == "ProductName").Value;
2415
var
entry = Assert.Single(modelState, e => e.Key == "OrderIds").Value;
2467
var
entry = Assert.Single(modelState, e => e.Key == "customParameter.OrderIds").Value;
2514
var
entry = Assert.Single(modelState, e => e.Key == "OrderIds[0]").Value;
2565
var
entry = Assert.Single(modelState, e => e.Key == "parameter.ProductId").Value;
2676
var
entry = kvp.Value;
2724
var
entry = kvp.Value;
2784
var
entry = kvp.Value;
2837
var
entry = kvp.Value;
2946
var
entry = Assert.Single(modelState, e => e.Key == "Id").Value;
ComplexTypeIntegrationTestBase.cs (45)
113
var
entry = Assert.Single(modelState, e => e.Key == "parameter.Customer.Name").Value;
163
var
entry = Assert.Single(modelState, e => e.Key == "Customer.Name").Value;
214
var
entry = Assert.Single(modelState, e => e.Key == "parameter.Customer.Name").Value;
263
var
entry = Assert.Single(modelState).Value;
370
var
entry = Assert.Single(modelState, e => e.Key == "parameter.Customer.Name").Value;
422
var
entry = Assert.Single(modelState, e => e.Key == "Customer.Name").Value;
474
var
entry = Assert.Single(modelState, e => e.Key == "parameter.Customer.Name").Value;
537
var
entry = Assert.Single(modelState, e => e.Key == "parameter.Customer.Name").Value;
590
var
entry = Assert.Single(modelState, e => e.Key == "Customer.Name").Value;
645
var
entry = kvp.Value;
702
var
entry = Assert.Single(modelState, e => e.Key == "parameter.ProductId").Value;
809
var
entry = Assert.Single(modelState, e => e.Key == "parameter.Name").Value;
864
var
entry = Assert.Single(modelState, e => e.Key == "Name").Value;
919
var
entry = Assert.Single(modelState, e => e.Key == "parameter.Name").Value;
1017
var
entry = Assert.Single(modelState, e => e.Key == "parameter.Name").Value;
1072
var
entry = Assert.Single(modelState, e => e.Key == "Name").Value;
1127
var
entry = Assert.Single(modelState, e => e.Key == "parameter.Name").Value;
1225
var
entry = Assert.Single(modelState, e => e.Key == "parameter.Name").Value;
1280
var
entry = Assert.Single(modelState, e => e.Key == "Name").Value;
1335
var
entry = Assert.Single(modelState, e => e.Key == "parameter.Name").Value;
1489
var
entry = Assert.Single(modelState, e => e.Key == "p.Name").Value;
1596
var
entry = Assert.Single(modelState, e => e.Key == "p.Name").Value;
1703
var
entry = Assert.Single(modelState, e => e.Key == "p.Name").Value;
1782
var
entry = Assert.Single(modelState, e => e.Key == "parameter.Name").Value;
1837
var
entry = Assert.Single(modelState, e => e.Key == "Name").Value;
1891
var
entry = Assert.Single(modelState, e => e.Key == "parameter.Name").Value;
1940
var
entry = Assert.Single(modelState, e => e.Key == "ProductId.Key").Value;
2012
var
entry = Assert.Single(modelState, e => e.Key == "p.Name").Value;
2145
var
entry = Assert.Single(modelState, e => e.Key == "Customer").Value;
2200
var
entry = Assert.Single(modelState, e => e.Key == "Customer").Value;
2263
var
entry = Assert.Single(modelState, e => e.Key == "parameter.Customer.Id").Value;
2317
var
entry = Assert.Single(modelState, e => e.Key == "Customer.Id").Value;
2375
var
entry = Assert.Single(modelState, e => e.Key == "customParameter.Customer.Id").Value;
2433
var
entry = Assert.Single(modelState, e => e.Key == "ProductName").Value;
2485
var
entry = Assert.Single(modelState, e => e.Key == "customParameter.ProductName").Value;
2533
var
entry = Assert.Single(modelState, e => e.Key == "ProductName").Value;
2585
var
entry = Assert.Single(modelState, e => e.Key == "OrderIds").Value;
2637
var
entry = Assert.Single(modelState, e => e.Key == "customParameter.OrderIds").Value;
2684
var
entry = Assert.Single(modelState, e => e.Key == "OrderIds[0]").Value;
2738
var
entry = Assert.Single(modelState, e => e.Key == "parameter.ProductId").Value;
2855
var
entry = kvp.Value;
2903
var
entry = kvp.Value;
2975
var
entry = kvp.Value;
3028
var
entry = kvp.Value;
3150
var
entry = Assert.Single(modelState, e => e.Key == "Id").Value;
DictionaryModelBinderIntegrationTest.cs (3)
48
var
entry = Assert.Single(modelState, kvp => kvp.Key == "parameter[0].Key").Value;
89
var
entry = kvp.Value;
127
var
entry = Assert.Single(modelState, kvp => kvp.Key == "parameter[low].Key").Value;
FormFileModelBindingIntegrationTest.cs (5)
509
var
modelStateEntry = kvp.Value;
598
var
modelStateEntry = kvp.Value;
737
var
entry = Assert.Single(modelState, e => e.Key == "p.Name").Value;
812
var
entry = Assert.Single(modelState, e => e.Key == "house.Garage.Cars[0].Name").Value;
1024
var
entry = Assert.Single(modelState, e => e.Key == "p.Name").Value;
GenericModelBinderIntegrationTest.cs (6)
292
var
entry = Assert.Single(modelState, e => e.Key == "parameter[0][0].Key").Value;
337
var
entry = Assert.Single(modelState, e => e.Key == "[0][0].Key").Value;
416
var
entry = Assert.Single(modelState, e => e.Key == "parameter[0].Key").Value;
460
var
entry = Assert.Single(modelState, e => e.Key == "[0].Key").Value;
540
var
entry = Assert.Single(modelState, e => e.Key == "parameter[0].Key").Value;
588
var
entry = Assert.Single(modelState, e => e.Key == "[0].Key").Value;
HeaderModelBinderIntegrationTest.cs (10)
190
var
modelStateEntry = kvp.Value;
237
var
modelStateEntry = kvp.Value;
364
var
entry = kvp.Value;
373
var
entry = kvp.Value;
382
var
entry = kvp.Value;
391
var
entry = kvp.Value;
400
var
entry = kvp.Value;
409
var
entry = kvp.Value;
418
var
entry = kvp.Value;
427
var
entry = kvp.Value;
KeyValuePairModelBinderIntegrationTest.cs (13)
44
var
entry = Assert.Single(modelState, kvp => kvp.Key == "parameter.Key").Value;
79
var
entry = Assert.Single(modelState, kvp => kvp.Key == "parameter.Key").Value;
129
var
entry = Assert.Single(modelState, kvp => kvp.Key == "parameter.Key").Value;
166
var
entry = Assert.Single(modelState, kvp => kvp.Key == "parameter.Key").Value;
216
var
entry = Assert.Single(modelState, kvp => kvp.Key == "parameter.Key").Value;
262
var
entry = Assert.Single(modelState, kvp => kvp.Key == "prefix.Key").Value;
302
var
entry = Assert.Single(modelState, kvp => kvp.Key == "Key").Value;
340
var
entry = Assert.Single(modelState, kvp => kvp.Key == "Key").Value;
381
var
entry = Assert.Single(modelState, kvp => kvp.Key == "parameter.Key").Value;
426
var
entry = Assert.Single(modelState, kvp => kvp.Key == "prefix.Key").Value;
467
var
entry = Assert.Single(modelState, kvp => kvp.Key == "Key").Value;
505
var
entry = Assert.Single(modelState, kvp => kvp.Key == "Key").Value;
543
var
entry = Assert.Single(modelState, kvp => kvp.Key == "p.Key").Value;
SimpleTypeModelBinderIntegrationTest.cs (3)
399
var
entry = modelState[key];
459
var
entry = modelState[key];
697
var
entry = modelState["Address.Lines"];
TryUpdateModelIntegrationTest.cs (23)
53
var
state = entry.Value;
87
var
state = entry.Value;
197
var
state = entry.Value;
238
var
state = entry.Value;
279
var
state = entry.Value;
340
var
state = entry.Value;
374
var
state = entry.Value;
403
var
state = entry.Value;
444
var
state = entry.Value;
492
var
state = entry.Value;
660
var
state = entry.Value;
694
var
state = entry.Value;
797
var
state = entry.Value;
833
var
state = entry.Value;
874
var
state = entry.Value;
925
var
state = entry.Value;
961
var
state = entry.Value;
1009
var
state = entry.Value;
1078
var
modelStateEntry = kvp.Value;
1130
var
state = entry.Value;
1201
var
state = entry.Value;
1256
var
state = kvp.Value;
1265
var
state = kvp.Value;
ValidationIntegrationTests.cs (37)
114
var
entry = Assert.Single(
194
var
entry = Assert.Single(modelState, e => e.Key == "parameter.CustomerName").Value;
231
var
entry = Assert.Single(modelState, e => e.Key == "CustomerName").Value;
283
var
entry = Assert.Single(modelState, e => e.Key == "parameter.Customer.Name").Value;
320
var
entry = Assert.Single(modelState, e => e.Key == "Customer").Value;
374
var
entry = Assert.Single(modelState, e => e.Key == "parameter.Customer.Name").Value;
414
var
entry = Assert.Single(modelState, e => e.Key == "parameter.Customer.Name").Value;
466
var
entry = Assert.Single(modelState, e => e.Key == "Items[0].ItemId").Value;
504
var
entry = Assert.Single(modelState, e => e.Key == "Items").Value;
552
var
entry = Assert.Single(modelState, e => e.Key == "parameter[0].ProductId").Value;
592
var
entry = Assert.Single(modelState, e => e.Key == "parameter[0].ProductId").Value;
669
var
entry = Assert.Single(modelState, e => e.Key == "parameter").Value;
710
var
entry = Assert.Single(modelState, e => e.Key == "parameter.Name").Value;
747
var
entry = Assert.Single(modelState, e => e.Key == "parameter.Name").Value;
798
var
entry = Assert.Single(modelState, e => e.Key == "parameter.Customer.Name").Value;
835
var
entry = Assert.Single(modelState, e => e.Key == "parameter.Customer.Name").Value;
933
var
entry = Assert.Single(modelState, e => e.Key == "parameter.Customer.Name").Value;
970
var
entry = Assert.Single(modelState, e => e.Key == "parameter.Customer.Name").Value;
1040
var
entry = Assert.Single(modelState, e => e.Key == "parameter.Products[0].Name").Value;
1077
var
entry = Assert.Single(modelState, e => e.Key == "parameter.Products[0].Name").Value;
1128
var
entry = Assert.Single(modelState, e => e.Key == "parameter[0].Name").Value;
1165
var
entry = Assert.Single(modelState, e => e.Key == "parameter[0].Name").Value;
1245
var
entry = state.Value;
1285
var
entry = state.Value;
1424
var
state = kvp.Value;
1462
var
state = kvp.Value;
1524
var
state = kvp.Value;
1755
var
entry = Assert.Single(modelState, e => e.Key == "HomeAddress.Country.Name").Value;
2055
var
entry = Assert.Single(modelState, e => e.Key == "[0]").Value;
2107
var
entry = Assert.Single(modelState, e => e.Key == "").Value;
2178
var
entry = Assert.Single(modelState, e => e.Key == "p[0].Id").Value;
2243
var
entry = Assert.Single(modelState, e => e.Key == "parameter[0].Key").Value;
2290
var
entry = Assert.Single(modelState, e => e.Key == "parameter[0].Key").Value;
2343
var
entry = Assert.Single(modelState, e => e.Key == "Model.Id").Value;
2397
var
entry = Assert.Single(modelState, e => e.Key == "Model.Id").Value;
2447
var
entry = Assert.Single(modelState, e => e.Key == "Property1").Value;
2499
var
entry = Assert.Single(modelState, e => e.Key == "Property1").Value;
ValidationWithRecordIntegrationTests.cs (36)
106
var
entry = Assert.Single(
182
var
entry = Assert.Single(modelState, e => e.Key == "parameter.CustomerName").Value;
219
var
entry = Assert.Single(modelState, e => e.Key == "CustomerName").Value;
264
var
entry = Assert.Single(modelState, e => e.Key == "parameter.Customer.Name").Value;
301
var
entry = Assert.Single(modelState, e => e.Key == "Customer").Value;
346
var
entry = Assert.Single(modelState, e => e.Key == "parameter.Customer.Name").Value;
386
var
entry = Assert.Single(modelState, e => e.Key == "parameter.Customer.Name").Value;
431
var
entry = Assert.Single(modelState, e => e.Key == "Items[0].ItemId").Value;
469
var
entry = Assert.Single(modelState, e => e.Key == "Items").Value;
511
var
entry = Assert.Single(modelState, e => e.Key == "parameter[0].ProductId").Value;
551
var
entry = Assert.Single(modelState, e => e.Key == "parameter[0].ProductId").Value;
593
var
entry = Assert.Single(modelState, e => e.Key == "parameter.Name").Value;
630
var
entry = Assert.Single(modelState, e => e.Key == "parameter.Name").Value;
674
var
entry = Assert.Single(modelState, e => e.Key == "parameter.Customer.Name").Value;
711
var
entry = Assert.Single(modelState, e => e.Key == "parameter.Customer.Name").Value;
802
var
entry = Assert.Single(modelState, e => e.Key == "parameter.Customer.Name").Value;
839
var
entry = Assert.Single(modelState, e => e.Key == "parameter.Customer.Name").Value;
902
var
entry = Assert.Single(modelState, e => e.Key == "parameter.Products[0].Name").Value;
939
var
entry = Assert.Single(modelState, e => e.Key == "parameter.Products[0].Name").Value;
986
var
entry = Assert.Single(modelState, e => e.Key == "parameter[0].Name").Value;
1023
var
entry = Assert.Single(modelState, e => e.Key == "parameter[0].Name").Value;
1097
var
entry = state.Value;
1137
var
entry = state.Value;
1268
var
state = kvp.Value;
1306
var
state = kvp.Value;
1558
var
entry = Assert.Single(modelState, e => e.Key == "HomeAddress.Country.Name").Value;
1846
var
entry = Assert.Single(modelState, e => e.Key == "[0]").Value;
1898
var
entry = Assert.Single(modelState, e => e.Key == "").Value;
1969
var
entry = Assert.Single(modelState, e => e.Key == "p[0].Id").Value;
2034
var
entry = Assert.Single(modelState, e => e.Key == "parameter[0].Key").Value;
2081
var
entry = Assert.Single(modelState, e => e.Key == "parameter[0].Key").Value;
2134
var
entry = Assert.Single(modelState, e => e.Key == "Model.Id").Value;
2185
var
entry = Assert.Single(modelState, e => e.Key == "Model.Id").Value;
2235
var
entry = Assert.Single(modelState, e => e.Key == "Property1").Value;
2285
var
entry = Assert.Single(modelState, e => e.Key == "Property1").Value;
2447
var
entry = Assert.Single(modelState, e => e.Key == "Property1").Value;
Microsoft.AspNetCore.Mvc.ViewFeatures (19)
DefaultHtmlGenerator.cs (7)
582
if (viewContext.ViewData.ModelState.TryGetValue(fullName, out
var
entry))
632
viewContext.ViewData.ModelState.TryGetValue(fullName, out
var
entry);
740
var tryGetModelStateResult = viewContext.ViewData.ModelState.TryGetValue(fullName, out
var
entry);
818
(!viewData.ModelState.TryGetValue(viewData.TemplateInfo.HtmlFieldPrefix, out
var
entryForModel) ||
847
foreach (
var
modelState in modelStates)
1066
if (viewContext.ViewData.ModelState.TryGetValue(key, out
var
entry) && entry.RawValue != null)
1262
if (viewContext.ViewData.ModelState.TryGetValue(fullName, out
var
entry) && entry.Errors.Count > 0)
ModelStateDictionaryExtensions.cs (3)
16
/// Adds the specified <paramref name="errorMessage"/> to the <see cref="
ModelStateEntry
.Errors"/> instance
38
/// Adds the specified <paramref name="exception"/> to the <see cref="
ModelStateEntry
.Errors"/> instance
64
/// Adds the specified <paramref name="exception"/> to the <see cref="
ModelStateEntry
.Errors"/> instance
ValidationHelpers.cs (9)
26
ModelStateEntry
containingEntry,
44
public static IList<
ModelStateEntry
> GetModelStateList(
50
viewData.ModelState.TryGetValue(viewData.TemplateInfo.HtmlFieldPrefix, out
var
ms);
61
var entries = new List<
ModelStateEntry
>();
79
return Array.Empty<
ModelStateEntry
>();
83
ModelStateEntry
modelStateEntry,
85
List<
ModelStateEntry
> orderedModelStateEntries)
89
foreach (
var
indexEntry in modelStateEntry.Children)
99
var
propertyModelStateEntry = modelStateEntry.GetModelStateForProperty(propertyMetadata.PropertyName);
Microsoft.AspNetCore.Mvc.ViewFeatures.Test (5)
ModelStateDictionaryExtensionsTest.cs (5)
297
var
expected = dictionary["Key"];
317
var
expected = dictionary["Key"];
336
var
expected = dictionary["child"];
359
var
expected = dictionary["Key"];
381
var
expected = dictionary["Key"];