462 references to ModelValidationState
Microsoft.AspNetCore.Mvc.Abstractions (39)
ModelBinding\ModelMetadata.cs (1)
436
/// When <see langword="false"/>, validation can be assume that the model is valid (<see cref="
ModelValidationState
.Valid"/>) without
ModelBinding\ModelStateDictionary.cs (35)
162
var
state = ValidationState;
163
return state ==
ModelValidationState
.Valid || state ==
ModelValidationState
.Skipped;
168
public
ModelValidationState
ValidationState => GetValidity(_root, currentDepth: 0) ??
ModelValidationState
.Valid;
357
modelState.ValidationState =
ModelValidationState
.Invalid;
366
/// Returns the aggregate <see cref="
ModelValidationState
"/> for items starting with the
370
/// <returns>Returns <see cref="
ModelValidationState
.Unvalidated"/> if no entries are found for the specified
371
/// key, <see cref="
ModelValidationState
.Invalid"/> if at least one instance is found with one or more model
372
/// state errors; <see cref="
ModelValidationState
.Valid"/> otherwise.</returns>
373
public
ModelValidationState
GetFieldValidationState(string key)
378
return GetValidity(item, currentDepth: 0) ??
ModelValidationState
.Unvalidated;
382
/// Returns <see cref="
ModelValidationState
"/> for the <paramref name="key"/>.
385
/// <returns>Returns <see cref="
ModelValidationState
.Unvalidated"/> if no entry is found for the specified
386
/// key, <see cref="
ModelValidationState
.Invalid"/> if an instance is found with one or more model
387
/// state errors; <see cref="
ModelValidationState
.Valid"/> otherwise.</returns>
388
public
ModelValidationState
GetValidationState(string key)
397
return
ModelValidationState
.Unvalidated;
402
/// <paramref name="key"/> as <see cref="
ModelValidationState
.Valid"/>.
410
if (modelState.ValidationState ==
ModelValidationState
.Invalid)
417
modelState.ValidationState =
ModelValidationState
.Valid;
422
/// as <see cref="
ModelValidationState
.Skipped"/>.
430
if (modelState.ValidationState ==
ModelValidationState
.Invalid)
437
modelState.ValidationState =
ModelValidationState
.Skipped;
523
entry.Value.ValidationState =
ModelValidationState
.Unvalidated;
620
private
ModelValidationState
? GetValidity(ModelStateNode? node, int currentDepth)
628
ModelValidationState
? validationState = null;
631
validationState =
ModelValidationState
.Valid;
632
if (node.ValidationState ==
ModelValidationState
.Unvalidated)
635
return
ModelValidationState
.Unvalidated;
638
if (node.ValidationState ==
ModelValidationState
.Invalid)
652
if (entryState ==
ModelValidationState
.Unvalidated)
657
if (validationState == null || entryState ==
ModelValidationState
.Invalid)
681
modelState.ValidationState =
ModelValidationState
.Invalid;
870
ValidationState =
ModelValidationState
.Unvalidated;
ModelBinding\ModelStateEntry.cs (2)
39
/// Gets or sets the <see cref="
ModelValidationState
"/> for this entry.
41
public
ModelValidationState
ValidationState { get; set; }
ModelBinding\ModelValidationState.cs (1)
9
/// <see cref="
ModelValidationState
"/> of <see cref="ModelStateDictionary.Root"/> is used to determine the validity
Microsoft.AspNetCore.Mvc.Abstractions.Test (76)
ModelBinding\ModelStateDictionaryTest.cs (76)
123
Assert.Equal(
ModelValidationState
.Valid, dictionary.ValidationState);
139
Assert.Equal(
ModelValidationState
.Valid, dictionary.ValidationState);
153
Assert.Equal(
ModelValidationState
.Skipped, source["key"].ValidationState);
167
Assert.Equal(
ModelValidationState
.Skipped, source["key"].ValidationState);
182
Assert.Equal(
ModelValidationState
.Skipped, source["key"].ValidationState);
212
Assert.Equal(
ModelValidationState
.Valid, source["key"].ValidationState);
226
Assert.Equal(
ModelValidationState
.Valid, source["key"].ValidationState);
241
Assert.Equal(
ModelValidationState
.Valid, source["key"].ValidationState);
271
entry.ValidationState =
ModelValidationState
.Skipped;
364
var
validationState = dictionary.GetFieldValidationState("foo");
367
Assert.Equal(
ModelValidationState
.Unvalidated, validationState);
378
var
validationState = dictionary.GetValidationState("foo");
381
Assert.Equal(
ModelValidationState
.Unvalidated, validationState);
395
var
validationState = dictionary.GetFieldValidationState("foo");
398
Assert.Equal(
ModelValidationState
.Invalid, validationState);
412
var
validationState = dictionary.GetFieldValidationState("foo");
415
Assert.Equal(
ModelValidationState
.Valid, validationState);
428
var
validationState = dictionary.GetFieldValidationState("[0].foo");
431
Assert.Equal(
ModelValidationState
.Invalid, validationState);
444
var
validationState = dictionary.GetFieldValidationState("[0].foo");
447
Assert.Equal(
ModelValidationState
.Valid, validationState);
460
var
validationState = dictionary.ValidationState;
464
Assert.Equal(
ModelValidationState
.Invalid, validationState);
477
var
validationState = dictionary.ValidationState;
481
Assert.Equal(
ModelValidationState
.Valid, validationState);
492
var
validationState = modelState.GetValidationState("foo");
493
var
fieldValidationState = modelState.GetFieldValidationState("foo");
496
Assert.Equal(
ModelValidationState
.Skipped, validationState);
497
Assert.Equal(
ModelValidationState
.Valid, fieldValidationState);
509
var
validationState = modelState.GetFieldValidationState("foo.bar");
512
Assert.Equal(
ModelValidationState
.Valid, validationState);
524
var
validationState = modelState.GetFieldValidationState("foo.bar");
527
Assert.Equal(
ModelValidationState
.Valid, validationState);
541
var
validationState = dictionary.ValidationState;
545
Assert.Equal(
ModelValidationState
.Unvalidated, validationState);
672
var
validationState = dictionary.GetFieldValidationState("not-user");
675
Assert.Equal(
ModelValidationState
.Unvalidated, validationState);
688
var
validationState = dictionary.GetFieldValidationState("user");
691
Assert.Equal(
ModelValidationState
.Unvalidated, validationState);
707
var
validationState = dictionary.GetFieldValidationState(key);
710
Assert.Equal(
ModelValidationState
.Invalid, validationState);
726
var
validationState = dictionary.GetFieldValidationState(key);
729
Assert.Equal(
ModelValidationState
.Invalid, validationState);
741
var
validationState = dictionary.GetFieldValidationState("user");
744
Assert.Equal(
ModelValidationState
.Valid, validationState);
1297
Assert.Equal(
ModelValidationState
.Unvalidated, dictionary["Property1"].ValidationState);
1299
Assert.Equal(
ModelValidationState
.Unvalidated, dictionary["Property2"].ValidationState);
1301
Assert.Equal(
ModelValidationState
.Invalid, dictionary["Property3"].ValidationState);
1303
Assert.Equal(
ModelValidationState
.Unvalidated, dictionary["Property4"].ValidationState);
1324
Assert.Equal(
ModelValidationState
.Unvalidated, dictionary["Product"].ValidationState);
1326
Assert.Equal(
ModelValidationState
.Unvalidated, dictionary["Product.Detail1"].ValidationState);
1328
Assert.Equal(
ModelValidationState
.Unvalidated, dictionary["Product.Detail2[0]"].ValidationState);
1330
Assert.Equal(
ModelValidationState
.Unvalidated, dictionary["Product.Detail2[1]"].ValidationState);
1332
Assert.Equal(
ModelValidationState
.Unvalidated, dictionary["Product.Detail2[2]"].ValidationState);
1334
Assert.Equal(
ModelValidationState
.Unvalidated, dictionary["Product.Detail3"].ValidationState);
1336
Assert.Equal(
ModelValidationState
.Invalid, dictionary["ProductName"].ValidationState);
1353
Assert.Equal(
ModelValidationState
.Valid, dictionary["Product"].ValidationState);
1355
Assert.Equal(
ModelValidationState
.Unvalidated, dictionary["Product.Detail1"].ValidationState);
1357
Assert.Equal(
ModelValidationState
.Unvalidated, dictionary["Product.Detail1.Name"].ValidationState);
1358
Assert.Equal(
ModelValidationState
.Skipped, dictionary["Product.Detail1Name"].ValidationState);
1378
Assert.Equal(
ModelValidationState
.Unvalidated, dictionary["Property1"].ValidationState);
1380
Assert.Equal(
ModelValidationState
.Unvalidated, dictionary["Property2"].ValidationState);
1382
Assert.Equal(
ModelValidationState
.Unvalidated, dictionary["Property3"].ValidationState);
1384
Assert.Equal(
ModelValidationState
.Unvalidated, dictionary["Property4"].ValidationState);
1415
Assert.Equal(
ModelValidationState
.Valid, entry.Value.ValidationState);
1423
Assert.Equal(
ModelValidationState
.Skipped, entry.Value.ValidationState);
1431
Assert.Equal(
ModelValidationState
.Unvalidated, entry.Value.ValidationState);
1439
Assert.Equal(
ModelValidationState
.Invalid, entry.Value.ValidationState);
1537
Assert.Equal(
ModelValidationState
.Valid, value.ValidationState);
1544
Assert.Equal(
ModelValidationState
.Skipped, value.ValidationState);
1551
Assert.Equal(
ModelValidationState
.Unvalidated, value.ValidationState);
1558
Assert.Equal(
ModelValidationState
.Invalid, value.ValidationState);
1614
var
validationState = dictionary.GetFieldValidationState("foo");
1617
Assert.Equal(
ModelValidationState
.Unvalidated, validationState);
1633
var
validationState = dictionary.ValidationState;
1637
Assert.Equal(
ModelValidationState
.Valid, validationState);
Microsoft.AspNetCore.Mvc.Core (19)
Infrastructure\ControllerActionInvoker.cs (2)
623
var
validationState = context.ModelState.ValidationState;
640
private static partial void ActionMethodExecuting(ILogger logger, string? actionName,
ModelValidationState
validationState);
ModelBinding\Binders\ComplexObjectModelBinder.cs (2)
727
var
validationState = modelState.GetFieldValidationState(modelName);
728
if (validationState ==
ModelValidationState
.Unvalidated)
ModelBinding\Binders\ComplexTypeModelBinder.cs (2)
565
var
validationState = modelState.GetFieldValidationState(modelName);
566
if (validationState ==
ModelValidationState
.Unvalidated)
ModelBinding\ModelBindingHelper.cs (2)
409
kvp.Value.ValidationState =
ModelValidationState
.Unvalidated;
429
entry.ValidationState =
ModelValidationState
.Unvalidated;
ModelBinding\Validation\ValidationVisitor.cs (11)
182
if (entry != null && entry.ValidationState !=
ModelValidationState
.Invalid)
184
entry.ValidationState =
ModelValidationState
.Valid;
205
var
state = ModelState.GetValidationState(Key);
209
if (state !=
ModelValidationState
.Invalid)
243
if (state ==
ModelValidationState
.Invalid)
254
entry.ValidationState =
ModelValidationState
.Valid;
337
ModelState.GetFieldValidationState(key) !=
ModelValidationState
.Invalid)
348
if (item.Value.ValidationState ==
ModelValidationState
.Unvalidated)
350
item.Value.ValidationState =
ModelValidationState
.Valid;
466
if (entry.Value.ValidationState !=
ModelValidationState
.Invalid)
468
entry.Value.ValidationState =
ModelValidationState
.Skipped;
Microsoft.AspNetCore.Mvc.Core.Test (99)
ModelBinding\Binders\ComplexObjectModelBinderTest.cs (1)
725
Assert.Equal(
ModelValidationState
.Invalid, entry.ValidationState);
ModelBinding\Binders\ComplexTypeModelBinderTest.cs (1)
869
Assert.Equal(
ModelValidationState
.Invalid, entry.ValidationState);
ModelBinding\Binders\SimpleTypeModelBinderTest.cs (1)
328
Assert.Equal(
ModelValidationState
.Invalid, entry.Value.ValidationState);
ModelBinding\Binders\TryParseTypeModelBinderTest.cs (1)
254
Assert.Equal(
ModelValidationState
.Invalid, entry.Value.ValidationState);
ModelBinding\ModelBindingHelperTest.cs (14)
655
Assert.Equal(
ModelValidationState
.Unvalidated, dictionary["Name"].ValidationState);
657
Assert.Equal(
ModelValidationState
.Unvalidated, dictionary["Id"].ValidationState);
659
Assert.Equal(
ModelValidationState
.Unvalidated, dictionary["Category"].ValidationState);
662
Assert.Equal(
ModelValidationState
.Invalid, dictionary["Unrelated"].ValidationState);
684
Assert.Equal(
ModelValidationState
.Unvalidated, dictionary[string.Empty].ValidationState);
687
Assert.Equal(
ModelValidationState
.Invalid, dictionary["Unrelated"].ValidationState);
715
Assert.Equal(
ModelValidationState
.Unvalidated, dictionary["[0].Name"].ValidationState);
717
Assert.Equal(
ModelValidationState
.Unvalidated, dictionary["[0].Id"].ValidationState);
719
Assert.Equal(
ModelValidationState
.Unvalidated, dictionary["[0].Category"].ValidationState);
721
Assert.Equal(
ModelValidationState
.Unvalidated, dictionary["[1].Name"].ValidationState);
723
Assert.Equal(
ModelValidationState
.Unvalidated, dictionary["[1].Id"].ValidationState);
725
Assert.Equal(
ModelValidationState
.Unvalidated, dictionary["[1].Category"].ValidationState);
728
Assert.Equal(
ModelValidationState
.Invalid, dictionary["Unrelated"].ValidationState);
764
Assert.Equal(
ModelValidationState
.Unvalidated, dictionary[entry].ValidationState);
ModelBinding\ParameterBinderTest.cs (4)
575
Assert.Equal(
ModelValidationState
.Invalid, kvp.Value.ValidationState);
636
Assert.Equal(
ModelValidationState
.Invalid, kvp.Value.ValidationState);
643
Assert.Equal(
ModelValidationState
.Invalid, kvp.Value.ValidationState);
701
Assert.Equal(
ModelValidationState
.Invalid, keyValuePair.Value.ValidationState);
ModelBinding\Validation\DefaultObjectValidatorTests.cs (77)
43
Assert.Equal(
ModelValidationState
.Valid, entry.ValidationState);
70
Assert.Equal(
ModelValidationState
.Valid, entry.ValidationState);
99
Assert.Equal(
ModelValidationState
.Skipped, entry.ValidationState);
126
Assert.Equal(
ModelValidationState
.Skipped, entry.ValidationState);
176
Assert.Equal(
ModelValidationState
.Valid, entry.ValidationState);
180
Assert.Equal(
ModelValidationState
.Valid, entry.ValidationState);
208
Assert.Equal(
ModelValidationState
.Valid, entry.ValidationState);
212
Assert.Equal(
ModelValidationState
.Valid, entry.ValidationState);
238
Assert.Equal(
ModelValidationState
.Invalid, entry.ValidationState);
243
Assert.Equal(
ModelValidationState
.Invalid, entry.ValidationState);
281
Assert.Equal(
ModelValidationState
.Valid, entry.ValidationState);
285
Assert.Equal(
ModelValidationState
.Skipped, entry.ValidationState);
313
Assert.Equal(
ModelValidationState
.Invalid, entry.ValidationState);
345
Assert.Equal(
ModelValidationState
.Invalid, entry.ValidationState);
377
Assert.Equal(
ModelValidationState
.Valid, entry.ValidationState);
380
Assert.Equal(
ModelValidationState
.Invalid, entry.ValidationState);
385
Assert.Equal(
ModelValidationState
.Invalid, entry.ValidationState);
390
Assert.Equal(
ModelValidationState
.Invalid, entry.ValidationState);
490
Assert.Equal(
ModelValidationState
.Invalid, entry.ValidationState);
495
Assert.Equal(
ModelValidationState
.Invalid, entry.ValidationState);
500
Assert.Equal(
ModelValidationState
.Invalid, entry.ValidationState);
505
Assert.Equal(
ModelValidationState
.Invalid, entry.ValidationState);
539
Assert.Equal(
ModelValidationState
.Unvalidated, entry.Value.ValidationState);
545
Assert.Equal(
ModelValidationState
.Invalid, entry.Value.ValidationState);
554
Assert.Equal(
ModelValidationState
.Invalid, entry.Value.ValidationState);
561
Assert.Equal(
ModelValidationState
.Invalid, entry.Value.ValidationState);
568
Assert.Equal(
ModelValidationState
.Invalid, entry.Value.ValidationState);
636
Assert.Equal(
ModelValidationState
.Valid, entry.ValidationState);
667
Assert.Equal(
ModelValidationState
.Valid, entry.ValidationState);
671
Assert.Equal(
ModelValidationState
.Invalid, entry.ValidationState);
703
Assert.Equal(
ModelValidationState
.Valid, entry.ValidationState);
707
Assert.Equal(
ModelValidationState
.Invalid, entry.ValidationState);
743
Assert.Equal(
ModelValidationState
.Invalid, entry.ValidationState);
773
Assert.Equal(
ModelValidationState
.Valid, entry.ValidationState);
777
Assert.Equal(
ModelValidationState
.Valid, entry.ValidationState);
804
Assert.Equal(
ModelValidationState
.Invalid, entry.ValidationState);
809
Assert.Equal(
ModelValidationState
.Invalid, entry.ValidationState);
814
Assert.Equal(
ModelValidationState
.Invalid, entry.ValidationState);
819
Assert.Equal(
ModelValidationState
.Invalid, entry.ValidationState);
847
Assert.Equal(
ModelValidationState
.Invalid, entry.ValidationState);
852
Assert.Equal(
ModelValidationState
.Invalid, entry.ValidationState);
857
Assert.Equal(
ModelValidationState
.Invalid, entry.ValidationState);
862
Assert.Equal(
ModelValidationState
.Invalid, entry.ValidationState);
929
Assert.Equal(
ModelValidationState
.Valid, entry.ValidationState);
933
Assert.Equal(
ModelValidationState
.Valid, entry.ValidationState);
937
Assert.Equal(
ModelValidationState
.Valid, entry.ValidationState);
1005
Assert.Equal(
ModelValidationState
.Valid, entry.ValidationState);
1009
Assert.Equal(
ModelValidationState
.Valid, entry.ValidationState);
1013
Assert.Equal(
ModelValidationState
.Valid, entry.ValidationState);
1017
Assert.Equal(
ModelValidationState
.Valid, entry.ValidationState);
1053
Assert.Equal(
ModelValidationState
.Valid, entry.ValidationState);
1057
Assert.Equal(
ModelValidationState
.Valid, entry.ValidationState);
1061
Assert.Equal(
ModelValidationState
.Invalid, entry.ValidationState);
1066
Assert.Equal(
ModelValidationState
.Invalid, entry.ValidationState);
1071
Assert.Equal(
ModelValidationState
.Invalid, entry.ValidationState);
1076
Assert.Equal(
ModelValidationState
.Invalid, entry.ValidationState);
1148
Assert.Equal(
ModelValidationState
.Valid, modelState.ValidationState);
1152
Assert.Equal(
ModelValidationState
.Skipped, entry.ValidationState);
1178
Assert.Equal(
ModelValidationState
.Valid, modelState.ValidationState);
1182
Assert.Equal(
ModelValidationState
.Skipped, entry.ValidationState);
1215
Assert.Equal(
ModelValidationState
.Valid, entry.Value.ValidationState);
1248
Assert.Equal(
ModelValidationState
.Invalid, kvp.Value.ValidationState);
1255
Assert.Equal(
ModelValidationState
.Invalid, kvp.Value.ValidationState);
1333
[InlineData(false,
ModelValidationState
.Unvalidated)]
1334
[InlineData(true,
ModelValidationState
.Invalid)]
1335
public void Validate_RespectsMvcOptionsConfiguration_WhenChildValidationFails(bool optionValue,
ModelValidationState
expectedParentValidationState)
1378
Assert.Equal(
ModelValidationState
.Valid, modelState.ValidationState);
1382
Assert.Equal(
ModelValidationState
.Valid, entry.ValidationState);
1385
Assert.Equal(
ModelValidationState
.Valid, entry.ValidationState);
1402
modelState["Property2"].ValidationState =
ModelValidationState
.Skipped;
1408
Assert.Equal(
ModelValidationState
.Valid, modelState.ValidationState);
1412
Assert.Equal(
ModelValidationState
.Valid, entry.ValidationState);
1415
Assert.Equal(
ModelValidationState
.Skipped, entry.ValidationState);
1432
modelState["Property2"].ValidationState =
ModelValidationState
.Invalid;
1438
Assert.Equal(
ModelValidationState
.Invalid, modelState.ValidationState);
1442
Assert.Equal(
ModelValidationState
.Valid, entry.ValidationState);
1445
Assert.Equal(
ModelValidationState
.Invalid, entry.ValidationState);
Microsoft.AspNetCore.Mvc.IntegrationTests (225)
ActionParametersIntegrationTest.cs (6)
72
Assert.Equal(
ModelValidationState
.Valid, modelState[key].ValidationState);
116
Assert.Equal(
ModelValidationState
.Valid, state.ValidationState);
166
Assert.Equal(
ModelValidationState
.Valid, modelState[key].ValidationState);
252
Assert.Equal(
ModelValidationState
.Valid, modelState[key].ValidationState);
296
Assert.Equal(
ModelValidationState
.Valid, state.ValidationState);
343
Assert.Equal(
ModelValidationState
.Valid, modelState[key].ValidationState);
BinderTypeBasedModelBinderIntegrationTest.cs (5)
118
Assert.Equal(
ModelValidationState
.Valid, modelState[key].ValidationState);
185
Assert.Equal(
ModelValidationState
.Valid, entry.ValidationState);
237
Assert.Equal(
ModelValidationState
.Valid, entry.ValidationState);
273
Assert.Equal(
ModelValidationState
.Valid, modelState[key].ValidationState);
312
Assert.Equal(
ModelValidationState
.Valid, modelState[key].ValidationState);
BodyValidationIntegrationTests.cs (2)
640
Assert.Equal(
ModelValidationState
.Invalid, street.ValidationState);
737
Assert.Equal(
ModelValidationState
.Invalid, street.ValidationState);
ByteArrayModelBinderIntegrationTest.cs (1)
64
Assert.Equal(
ModelValidationState
.Valid, entry.Value.ValidationState);
CollectionModelBinderIntegrationTest.cs (14)
330
Assert.Equal(
ModelValidationState
.Invalid, entry.ValidationState);
336
Assert.Equal(
ModelValidationState
.Invalid, entry.ValidationState);
389
Assert.Equal(
ModelValidationState
.Invalid, entry.ValidationState);
393
Assert.Equal(
ModelValidationState
.Invalid, entry.ValidationState);
440
Assert.Equal(
ModelValidationState
.Invalid, entry.ValidationState);
444
Assert.Equal(
ModelValidationState
.Invalid, entry.ValidationState);
483
Assert.Equal(
ModelValidationState
.Valid, entry.ValidationState);
488
Assert.Equal(
ModelValidationState
.Valid, entry.ValidationState);
535
Assert.Equal(
ModelValidationState
.Invalid, entry.ValidationState);
539
Assert.Equal(
ModelValidationState
.Invalid, entry.ValidationState);
1166
Assert.Equal(
ModelValidationState
.Valid, kvp.Value.ValidationState);
1171
Assert.Equal(
ModelValidationState
.Valid, kvp.Value.ValidationState);
1215
Assert.Equal(
ModelValidationState
.Valid, kvp.Value.ValidationState);
1220
Assert.Equal(
ModelValidationState
.Valid, kvp.Value.ValidationState);
ComplexRecordIntegrationTest.cs (6)
2679
Assert.Equal(
ModelValidationState
.Valid, entry.ValidationState);
2727
Assert.Equal(
ModelValidationState
.Valid, entry.ValidationState);
2787
Assert.Equal(
ModelValidationState
.Valid, entry.ValidationState);
2840
Assert.Equal(
ModelValidationState
.Valid, entry.ValidationState);
3090
Assert.Equal(
ModelValidationState
.Valid, kvp.Value.ValidationState);
3098
Assert.Equal(
ModelValidationState
.Valid, kvp.Value.ValidationState);
ComplexTypeIntegrationTestBase.cs (6)
2858
Assert.Equal(
ModelValidationState
.Valid, entry.ValidationState);
2906
Assert.Equal(
ModelValidationState
.Valid, entry.ValidationState);
2978
Assert.Equal(
ModelValidationState
.Valid, entry.ValidationState);
3031
Assert.Equal(
ModelValidationState
.Valid, entry.ValidationState);
3305
Assert.Equal(
ModelValidationState
.Valid, kvp.Value.ValidationState);
3313
Assert.Equal(
ModelValidationState
.Valid, kvp.Value.ValidationState);
DictionaryModelBinderIntegrationTest.cs (14)
130
Assert.Equal(
ModelValidationState
.Valid, entry.ValidationState);
135
Assert.Equal(
ModelValidationState
.Valid, entry.ValidationState);
810
Assert.NotEqual(
ModelValidationState
.Unvalidated, kvp.Value.ValidationState);
811
Assert.NotEqual(
ModelValidationState
.Skipped, kvp.Value.ValidationState);
814
var entry = Assert.Single(modelState, kvp => kvp.Value.ValidationState ==
ModelValidationState
.Invalid);
1269
Assert.Equal(
ModelValidationState
.Valid, kvp.Value.ValidationState);
1332
Assert.Equal(
ModelValidationState
.Invalid, kvp.Value.ValidationState);
1338
Assert.Equal(
ModelValidationState
.Valid, kvp.Value.ValidationState);
1343
Assert.Equal(
ModelValidationState
.Valid, kvp.Value.ValidationState);
1348
Assert.Equal(
ModelValidationState
.Invalid, kvp.Value.ValidationState);
1485
Assert.Equal(
ModelValidationState
.Invalid, kvp.Value.ValidationState);
1491
Assert.Equal(
ModelValidationState
.Valid, kvp.Value.ValidationState);
1496
Assert.Equal(
ModelValidationState
.Valid, kvp.Value.ValidationState);
1501
Assert.Equal(
ModelValidationState
.Invalid, kvp.Value.ValidationState);
FormCollectionModelBindingIntegrationTest.cs (1)
70
Assert.Equal(
ModelValidationState
.Valid, entry.Value.ValidationState);
FormFileModelBindingIntegrationTest.cs (14)
71
Assert.Equal(
ModelValidationState
.Valid, modelState[key].ValidationState);
121
Assert.Equal(
ModelValidationState
.Valid, value.ValidationState);
172
Assert.Equal(
ModelValidationState
.Valid, value.ValidationState);
235
Assert.Equal(
ModelValidationState
.Valid, value.ValidationState);
243
Assert.Equal(
ModelValidationState
.Valid, value.ValidationState);
325
Assert.Equal(
ModelValidationState
.Valid, value.ValidationState);
331
Assert.Equal(
ModelValidationState
.Valid, value.ValidationState);
391
Assert.Equal(
ModelValidationState
.Valid, value.ValidationState);
397
Assert.Equal(
ModelValidationState
.Valid, value.ValidationState);
453
Assert.Equal(
ModelValidationState
.Valid, value.ValidationState);
461
Assert.Equal(
ModelValidationState
.Valid, value.ValidationState);
512
Assert.Equal(
ModelValidationState
.Valid, modelStateEntry.ValidationState);
601
Assert.Equal(
ModelValidationState
.Valid, modelStateEntry.ValidationState);
650
Assert.Equal(
ModelValidationState
.Valid, entry.Value.ValidationState);
HeaderModelBinderIntegrationTest.cs (13)
104
Assert.Equal(
ModelValidationState
.Valid, entry.Value.ValidationState);
146
Assert.Equal(
ModelValidationState
.Valid, entry.Value.ValidationState);
193
Assert.Equal(
ModelValidationState
.Valid, modelStateEntry.ValidationState);
240
Assert.Equal(
ModelValidationState
.Valid, modelStateEntry.ValidationState);
300
Assert.Equal(
ModelValidationState
.Valid, entry.Value.ValidationState);
366
Assert.Equal(
ModelValidationState
.Valid, entry.ValidationState);
375
Assert.Equal(
ModelValidationState
.Valid, entry.ValidationState);
384
Assert.Equal(
ModelValidationState
.Valid, entry.ValidationState);
393
Assert.Equal(
ModelValidationState
.Valid, entry.ValidationState);
402
Assert.Equal(
ModelValidationState
.Valid, entry.ValidationState);
411
Assert.Equal(
ModelValidationState
.Valid, entry.ValidationState);
420
Assert.Equal(
ModelValidationState
.Valid, entry.ValidationState);
429
Assert.Equal(
ModelValidationState
.Valid, entry.ValidationState);
NullableReferenceTypeIntegrationTest.cs (3)
54
Assert.Equal(
ModelValidationState
.Invalid, kvp.Value.ValidationState);
141
Assert.Equal(
ModelValidationState
.Invalid, kvp.Value.ValidationState);
196
Assert.Equal(
ModelValidationState
.Invalid, kvp.Value.ValidationState);
SimpleTypeModelBinderIntegrationTest.cs (11)
63
Assert.Equal(
ModelValidationState
.Valid, modelState[key].ValidationState);
107
Assert.Equal(
ModelValidationState
.Valid, modelState[key].ValidationState);
151
Assert.Equal(
ModelValidationState
.Valid, modelState[key].ValidationState);
228
Assert.Equal(
ModelValidationState
.Valid, modelState[key].ValidationState);
272
Assert.Equal(
ModelValidationState
.Valid, modelState[key].ValidationState);
357
Assert.Equal(
ModelValidationState
.Valid, modelState[key].ValidationState);
402
Assert.Equal(
ModelValidationState
.Invalid, entry.ValidationState);
462
Assert.Equal(
ModelValidationState
.Invalid, entry.ValidationState);
700
Assert.Equal(
ModelValidationState
.Valid, entry.ValidationState);
746
Assert.Equal(
ModelValidationState
.Valid, modelState[key].ValidationState);
790
Assert.Equal(
ModelValidationState
.Valid, modelState[key].ValidationState);
TryUpdateModelIntegrationTest.cs (24)
57
Assert.Equal(
ModelValidationState
.Valid, state.ValidationState);
91
Assert.Equal(
ModelValidationState
.Valid, state.ValidationState);
201
Assert.Equal(
ModelValidationState
.Valid, state.ValidationState);
242
Assert.Equal(
ModelValidationState
.Valid, state.ValidationState);
283
Assert.Equal(
ModelValidationState
.Valid, state.ValidationState);
344
Assert.Equal(
ModelValidationState
.Valid, state.ValidationState);
376
Assert.Equal(
ModelValidationState
.Valid, state.ValidationState);
405
Assert.Equal(
ModelValidationState
.Valid, state.ValidationState);
448
Assert.Equal(
ModelValidationState
.Valid, state.ValidationState);
496
Assert.Equal(
ModelValidationState
.Valid, state.ValidationState);
664
Assert.Equal(
ModelValidationState
.Valid, state.ValidationState);
698
Assert.Equal(
ModelValidationState
.Valid, state.ValidationState);
801
Assert.Equal(
ModelValidationState
.Valid, state.ValidationState);
837
Assert.Equal(
ModelValidationState
.Valid, state.ValidationState);
878
Assert.Equal(
ModelValidationState
.Valid, state.ValidationState);
929
Assert.Equal(
ModelValidationState
.Valid, state.ValidationState);
965
Assert.Equal(
ModelValidationState
.Valid, state.ValidationState);
1013
Assert.Equal(
ModelValidationState
.Valid, state.ValidationState);
1081
Assert.Equal(
ModelValidationState
.Valid, modelStateEntry.ValidationState);
1134
Assert.Equal(
ModelValidationState
.Valid, state.ValidationState);
1205
Assert.Equal(
ModelValidationState
.Valid, state.ValidationState);
1212
Assert.Equal(
ModelValidationState
.Valid, state.ValidationState);
1260
Assert.Equal(
ModelValidationState
.Valid, state.ValidationState);
1269
Assert.Equal(
ModelValidationState
.Valid, state.ValidationState);
ValidationIntegrationTests.cs (53)
234
Assert.Equal(
ModelValidationState
.Invalid, entry.ValidationState);
323
Assert.Equal(
ModelValidationState
.Invalid, entry.ValidationState);
417
Assert.Equal(
ModelValidationState
.Invalid, entry.ValidationState);
507
Assert.Equal(
ModelValidationState
.Invalid, entry.ValidationState);
595
Assert.Equal(
ModelValidationState
.Invalid, entry.ValidationState);
670
Assert.Equal(
ModelValidationState
.Invalid, entry.ValidationState);
977
Assert.Equal(
ModelValidationState
.Invalid, entry.ValidationState);
1084
Assert.Equal(
ModelValidationState
.Invalid, entry.ValidationState);
1378
Assert.Equal(
ModelValidationState
.Invalid, state.Value.ValidationState);
1391
Assert.Equal(
ModelValidationState
.Valid, state.Value.ValidationState);
1426
Assert.Equal(
ModelValidationState
.Invalid, state.ValidationState);
1464
Assert.Equal(
ModelValidationState
.Skipped, state.ValidationState);
1526
Assert.Equal(
ModelValidationState
.Skipped, state.ValidationState);
1601
Assert.Equal(
ModelValidationState
.Skipped, kvp.Value.ValidationState);
1643
Assert.Equal(
ModelValidationState
.Valid, state.Value.ValidationState);
1691
Assert.Equal(
ModelValidationState
.Valid, kvp.Value.ValidationState);
1758
Assert.Equal(
ModelValidationState
.Skipped, entry.ValidationState);
1763
Assert.Equal(
ModelValidationState
.Skipped, entry.ValidationState);
1768
Assert.Equal(
ModelValidationState
.Skipped, entry.ValidationState);
1816
Assert.Equal(
ModelValidationState
.Skipped, entry.Value.ValidationState);
1858
Assert.Equal(
ModelValidationState
.Unvalidated, entry.Value.ValidationState);
1904
Assert.Equal(
ModelValidationState
.Unvalidated, entry.Value.ValidationState);
1951
Assert.Equal(
ModelValidationState
.Invalid, entry.Value.ValidationState);
1954
Assert.Equal(
ModelValidationState
.Unvalidated, entry.Value.ValidationState);
2004
Assert.Equal(
ModelValidationState
.Valid, modelState.ValidationState);
2053
Assert.Equal(
ModelValidationState
.Valid, modelState.ValidationState);
2058
Assert.Equal(
ModelValidationState
.Valid, entry.ValidationState);
2063
Assert.Equal(
ModelValidationState
.Valid, entry.ValidationState);
2105
Assert.Equal(
ModelValidationState
.Invalid, modelState.ValidationState);
2108
Assert.Equal(
ModelValidationState
.Invalid, entry.ValidationState);
2113
Assert.Equal(
ModelValidationState
.Valid, entry.ValidationState);
2118
Assert.Equal(
ModelValidationState
.Valid, entry.ValidationState);
2176
Assert.Equal(
ModelValidationState
.Invalid, modelState.ValidationState);
2181
Assert.Equal(
ModelValidationState
.Valid, entry.ValidationState);
2184
Assert.Equal(
ModelValidationState
.Invalid, entry.ValidationState);
2189
Assert.Equal(
ModelValidationState
.Valid, entry.ValidationState);
2241
Assert.Equal(
ModelValidationState
.Valid, modelState.ValidationState);
2246
Assert.Equal(
ModelValidationState
.Valid, entry.ValidationState);
2251
Assert.Equal(
ModelValidationState
.Valid, entry.ValidationState);
2288
Assert.Equal(
ModelValidationState
.Invalid, modelState.ValidationState);
2293
Assert.Equal(
ModelValidationState
.Valid, entry.ValidationState);
2298
Assert.Equal(
ModelValidationState
.Valid, entry.ValidationState);
2301
Assert.Equal(
ModelValidationState
.Invalid, entry.ValidationState);
2341
Assert.Equal(
ModelValidationState
.Valid, modelState.ValidationState);
2346
Assert.Equal(
ModelValidationState
.Valid, entry.ValidationState);
2395
Assert.Equal(
ModelValidationState
.Invalid, modelState.ValidationState);
2400
Assert.Equal(
ModelValidationState
.Valid, entry.ValidationState);
2403
Assert.Equal(
ModelValidationState
.Invalid, entry.ValidationState);
2445
Assert.Equal(
ModelValidationState
.Valid, modelState.ValidationState);
2450
Assert.Equal(
ModelValidationState
.Valid, entry.ValidationState);
2497
Assert.Equal(
ModelValidationState
.Valid, modelState.ValidationState);
2502
Assert.Equal(
ModelValidationState
.Valid, entry.ValidationState);
2547
Assert.Equal(
ModelValidationState
.Valid, modelState.ValidationState);
ValidationWithRecordIntegrationTests.cs (52)
222
Assert.Equal(
ModelValidationState
.Invalid, entry.ValidationState);
304
Assert.Equal(
ModelValidationState
.Invalid, entry.ValidationState);
389
Assert.Equal(
ModelValidationState
.Invalid, entry.ValidationState);
472
Assert.Equal(
ModelValidationState
.Invalid, entry.ValidationState);
554
Assert.Equal(
ModelValidationState
.Invalid, entry.ValidationState);
846
Assert.Equal(
ModelValidationState
.Invalid, entry.ValidationState);
946
Assert.Equal(
ModelValidationState
.Invalid, entry.ValidationState);
1222
Assert.Equal(
ModelValidationState
.Invalid, state.Value.ValidationState);
1235
Assert.Equal(
ModelValidationState
.Valid, state.Value.ValidationState);
1270
Assert.Equal(
ModelValidationState
.Invalid, state.ValidationState);
1308
Assert.Equal(
ModelValidationState
.Skipped, state.ValidationState);
1409
Assert.Equal(
ModelValidationState
.Skipped, kvp.Value.ValidationState);
1451
Assert.Equal(
ModelValidationState
.Valid, state.Value.ValidationState);
1497
Assert.Equal(
ModelValidationState
.Valid, kvp.Value.ValidationState);
1561
Assert.Equal(
ModelValidationState
.Skipped, entry.ValidationState);
1566
Assert.Equal(
ModelValidationState
.Skipped, entry.ValidationState);
1571
Assert.Equal(
ModelValidationState
.Skipped, entry.ValidationState);
1619
Assert.Equal(
ModelValidationState
.Skipped, entry.Value.ValidationState);
1661
Assert.Equal(
ModelValidationState
.Unvalidated, entry.Value.ValidationState);
1707
Assert.Equal(
ModelValidationState
.Unvalidated, entry.Value.ValidationState);
1754
Assert.Equal(
ModelValidationState
.Invalid, entry.Value.ValidationState);
1757
Assert.Equal(
ModelValidationState
.Unvalidated, entry.Value.ValidationState);
1799
Assert.Equal(
ModelValidationState
.Valid, modelState.ValidationState);
1844
Assert.Equal(
ModelValidationState
.Valid, modelState.ValidationState);
1849
Assert.Equal(
ModelValidationState
.Valid, entry.ValidationState);
1854
Assert.Equal(
ModelValidationState
.Valid, entry.ValidationState);
1896
Assert.Equal(
ModelValidationState
.Invalid, modelState.ValidationState);
1899
Assert.Equal(
ModelValidationState
.Invalid, entry.ValidationState);
1904
Assert.Equal(
ModelValidationState
.Valid, entry.ValidationState);
1909
Assert.Equal(
ModelValidationState
.Valid, entry.ValidationState);
1967
Assert.Equal(
ModelValidationState
.Invalid, modelState.ValidationState);
1972
Assert.Equal(
ModelValidationState
.Valid, entry.ValidationState);
1975
Assert.Equal(
ModelValidationState
.Invalid, entry.ValidationState);
1980
Assert.Equal(
ModelValidationState
.Valid, entry.ValidationState);
2032
Assert.Equal(
ModelValidationState
.Valid, modelState.ValidationState);
2037
Assert.Equal(
ModelValidationState
.Valid, entry.ValidationState);
2042
Assert.Equal(
ModelValidationState
.Valid, entry.ValidationState);
2079
Assert.Equal(
ModelValidationState
.Invalid, modelState.ValidationState);
2084
Assert.Equal(
ModelValidationState
.Valid, entry.ValidationState);
2089
Assert.Equal(
ModelValidationState
.Valid, entry.ValidationState);
2092
Assert.Equal(
ModelValidationState
.Invalid, entry.ValidationState);
2132
Assert.Equal(
ModelValidationState
.Valid, modelState.ValidationState);
2137
Assert.Equal(
ModelValidationState
.Valid, entry.ValidationState);
2183
Assert.Equal(
ModelValidationState
.Invalid, modelState.ValidationState);
2188
Assert.Equal(
ModelValidationState
.Valid, entry.ValidationState);
2191
Assert.Equal(
ModelValidationState
.Invalid, entry.ValidationState);
2233
Assert.Equal(
ModelValidationState
.Valid, modelState.ValidationState);
2238
Assert.Equal(
ModelValidationState
.Valid, entry.ValidationState);
2283
Assert.Equal(
ModelValidationState
.Valid, modelState.ValidationState);
2288
Assert.Equal(
ModelValidationState
.Valid, entry.ValidationState);
2450
Assert.Equal(
ModelValidationState
.Valid, entry.ValidationState);
2453
Assert.Equal(
ModelValidationState
.Invalid, entry.ValidationState);
Microsoft.AspNetCore.Mvc.RazorPages (4)
PageLoggerExtensions.cs (4)
80
private static partial void ExecutingHandlerMethod(this ILogger logger, string handlerName,
ModelValidationState
validationState);
92
var
validationState = context.ModelState.ValidationState;
109
public static partial void ExecutingImplicitHandlerMethod(this ILogger logger,
ModelValidationState
validationState);
115
var
validationState = context.ModelState.ValidationState;