Base:
property
ModelState
Microsoft.AspNetCore.Mvc.ModelBinding.ModelBindingContext.ModelState
27 writes to ModelState
Microsoft.AspNetCore.Mvc.Core (1)
ModelBinding\DefaultModelBindingContext.cs (1)
228
ModelState
= actionContext.ModelState,
Microsoft.AspNetCore.Mvc.Core.Test (26)
ModelBinding\Binders\ArrayModelBinderTest.cs (1)
238
ModelState
= actionContext.ModelState,
ModelBinding\Binders\BinderTypeModelBinderTest.cs (1)
82
ModelState
= new ModelStateDictionary(),
ModelBinding\Binders\BodyModelBinderTests.cs (1)
700
ModelState
= new ModelStateDictionary(),
ModelBinding\Binders\ByteArrayModelBinderTests.cs (1)
110
ModelState
= new ModelStateDictionary(),
ModelBinding\Binders\CollectionModelBinderTest.cs (1)
538
ModelState
= actionContext.ModelState,
ModelBinding\Binders\ComplexObjectModelBinderTest.cs (4)
293
ModelState
= new ModelStateDictionary(),
345
ModelState
= new ModelStateDictionary(),
389
ModelState
= new ModelStateDictionary(),
1117
ModelState
= new ModelStateDictionary(),
ModelBinding\Binders\ComplexTypeModelBinderTest.cs (5)
305
ModelState
= new ModelStateDictionary(),
353
ModelState
= new ModelStateDictionary(),
405
ModelState
= new ModelStateDictionary(),
449
ModelState
= new ModelStateDictionary(),
1281
ModelState
= new ModelStateDictionary(),
ModelBinding\Binders\DateTimeModelBinderTest.cs (1)
214
ModelState
= new ModelStateDictionary(),
ModelBinding\Binders\DictionaryModelBinderTest.cs (1)
629
ModelState
= actionContext.ModelState,
ModelBinding\Binders\EnumTypeModelBinderTest.cs (1)
245
ModelState
= new ModelStateDictionary(),
ModelBinding\Binders\FloatingPointTypeModelBinderTestOfT.cs (1)
375
ModelState
= new ModelStateDictionary(),
ModelBinding\Binders\FormFileModelBinderTest.cs (1)
465
ModelState
= new ModelStateDictionary(),
ModelBinding\Binders\HeaderModelBinderTests.cs (1)
361
ModelState
= new ModelStateDictionary(),
ModelBinding\Binders\KeyValuePairModelBinderTest.cs (2)
207
ModelState
= new ModelStateDictionary(),
222
ModelState
= new ModelStateDictionary(),
ModelBinding\Binders\ServicesModelBinderTest.cs (1)
54
ModelState
= new ModelStateDictionary(),
ModelBinding\Binders\SimpleTypeModelBinderTest.cs (1)
492
ModelState
= new ModelStateDictionary(),
ModelBinding\Binders\TryParseTypeModelBinderTest.cs (1)
497
ModelState
= new ModelStateDictionary(),
ModelBinding\DefaultModelBindingContextTest.cs (1)
26
ModelState
= new ModelStateDictionary(),
139 references to ModelState
Microsoft.AspNetCore.Mvc.Core.Test (139)
ModelBinding\Binders\ArrayModelBinderTest.cs (3)
83
Assert.Equal(expectedErrorCount, bindingContext.
ModelState
.ErrorCount);
118
var keyValuePair = Assert.Single(bindingContext.
ModelState
);
162
Assert.Equal(0, bindingContext.
ModelState
.ErrorCount);
ModelBinding\Binders\BodyModelBinderTests.cs (15)
70
var entry = Assert.Single(bindingContext.
ModelState
);
95
var entry = Assert.Single(bindingContext.
ModelState
);
150
Assert.False(bindingContext.
ModelState
.IsValid);
153
var entry = Assert.Single(bindingContext.
ModelState
);
216
Assert.True(bindingContext.
ModelState
.IsValid);
242
Assert.False(bindingContext.
ModelState
.IsValid);
243
Assert.Single(bindingContext.
ModelState
[bindingContext.BinderModelName].Errors);
244
Assert.Equal("Unsupported content type ''.", bindingContext.
ModelState
[bindingContext.BinderModelName].Errors[0].Exception.Message);
275
var entry = Assert.Single(bindingContext.
ModelState
);
318
var entry = Assert.Single(bindingContext.
ModelState
);
349
var entry = Assert.Single(bindingContext.
ModelState
);
389
var entry = Assert.Single(bindingContext.
ModelState
);
420
var entry = Assert.Single(bindingContext.
ModelState
);
500
var entry = Assert.Single(bindingContext.
ModelState
);
556
var entry = Assert.Single(bindingContext.
ModelState
);
ModelBinding\Binders\ByteArrayModelBinderTests.cs (4)
31
var modelState = Assert.Single(bindingContext.
ModelState
);
76
Assert.False(bindingContext.
ModelState
.IsValid);
77
var error = Assert.Single(bindingContext.
ModelState
["foo"].Errors);
100
Assert.Empty(bindingContext.
ModelState
); // No submitted data for "foo".
ModelBinding\Binders\CollectionModelBinderTest.cs (8)
77
var modelState = bindingContext.
ModelState
;
106
var modelState = bindingContext.
ModelState
;
134
var modelState = bindingContext.
ModelState
;
158
var modelState = bindingContext.
ModelState
;
269
Assert.Equal(0, bindingContext.
ModelState
.ErrorCount);
304
var keyValuePair = Assert.Single(bindingContext.
ModelState
);
344
Assert.Equal(0, bindingContext.
ModelState
.ErrorCount);
418
Assert.Equal(0, bindingContext.
ModelState
.ErrorCount);
ModelBinding\Binders\ComplexObjectModelBinderTest.cs (20)
316
var keyValuePair = Assert.Single(bindingContext.
ModelState
);
360
var keyValuePair = Assert.Single(bindingContext.
ModelState
);
404
var keyValuePair = Assert.Single(bindingContext.
ModelState
);
615
var modelStateDictionary = bindingContext.
ModelState
;
680
var modelStateDictionary = bindingContext.
ModelState
;
719
var modelStateDictionary = bindingContext.
ModelState
;
751
var modelStateDictionary = bindingContext.
ModelState
;
774
var modelStateDictionary = bindingContext.
ModelState
;
799
Assert.True(bindingContext.
ModelState
.IsValid);
824
Assert.True(bindingContext.
ModelState
.IsValid);
858
Assert.True(bindingContext.
ModelState
.IsValid);
880
Assert.True(bindingContext.
ModelState
.IsValid);
904
Assert.True(bindingContext.
ModelState
.IsValid);
928
Assert.True(bindingContext.
ModelState
.IsValid);
980
var modelState = bindingContext.
ModelState
;
1033
Assert.True(bindingContext.
ModelState
.IsValid);
1058
bindingContext.
ModelState
["foo"].Errors[0].Exception.Message);
1078
Assert.False(bindingContext.
ModelState
.IsValid);
1079
Assert.Single(bindingContext.
ModelState
["foo.NameNoAttribute"].Errors);
1081
bindingContext.
ModelState
["foo.NameNoAttribute"].Errors[0].Exception.Message);
ModelBinding\Binders\ComplexTypeModelBinderTest.cs (21)
327
Assert.Equal(expectedErrorCount, bindingContext.
ModelState
.ErrorCount);
376
var keyValuePair = Assert.Single(bindingContext.
ModelState
);
420
var keyValuePair = Assert.Single(bindingContext.
ModelState
);
464
var keyValuePair = Assert.Single(bindingContext.
ModelState
);
793
var modelStateDictionary = bindingContext.
ModelState
;
827
var modelStateDictionary = bindingContext.
ModelState
;
863
var modelStateDictionary = bindingContext.
ModelState
;
892
var modelStateDictionary = bindingContext.
ModelState
;
912
var modelStateDictionary = bindingContext.
ModelState
;
934
Assert.True(bindingContext.
ModelState
.IsValid);
956
Assert.True(bindingContext.
ModelState
.IsValid);
994
Assert.True(bindingContext.
ModelState
.IsValid);
1042
Assert.True(bindingContext.
ModelState
.IsValid);
1066
Assert.True(bindingContext.
ModelState
.IsValid);
1090
Assert.True(bindingContext.
ModelState
.IsValid);
1142
var modelState = bindingContext.
ModelState
;
1195
Assert.True(bindingContext.
ModelState
.IsValid);
1220
bindingContext.
ModelState
["foo"].Errors[0].Exception.Message);
1240
Assert.False(bindingContext.
ModelState
.IsValid);
1241
Assert.Single(bindingContext.
ModelState
["foo.NameNoAttribute"].Errors);
1243
bindingContext.
ModelState
["foo.NameNoAttribute"].Errors[0].Exception.Message);
ModelBinding\Binders\DateTimeModelBinderTest.cs (9)
47
Assert.False(bindingContext.
ModelState
.IsValid);
49
var error = Assert.Single(bindingContext.
ModelState
["theModelName"].Errors);
71
var error = Assert.Single(bindingContext.
ModelState
["theModelName"].Errors);
88
Assert.Empty(bindingContext.
ModelState
);
103
Assert.Empty(bindingContext.
ModelState
);
127
var error = Assert.Single(bindingContext.
ModelState
["theModelName"].Errors);
150
var entry = Assert.Single(bindingContext.
ModelState
);
176
Assert.True(bindingContext.
ModelState
.ContainsKey("theModelName"));
199
Assert.True(bindingContext.
ModelState
.ContainsKey("theModelName"));
ModelBinding\Binders\DictionaryModelBinderTest.cs (4)
454
Assert.Equal(expectedErrorCount, bindingContext.
ModelState
.ErrorCount);
490
var keyValuePair = Assert.Single(bindingContext.
ModelState
);
538
Assert.Equal(expectedErrorCount, bindingContext.
ModelState
.ErrorCount);
582
Assert.Equal(0, bindingContext.
ModelState
.ErrorCount);
ModelBinding\Binders\EnumTypeModelBinderTest.cs (6)
42
Assert.False(bindingContext.
ModelState
.IsValid);
43
var error = Assert.Single(bindingContext.
ModelState
["theModelName"].Errors);
147
Assert.False(bindingContext.
ModelState
.IsValid);
148
var error = Assert.Single(bindingContext.
ModelState
["theModelName"].Errors);
230
Assert.False(bindingContext.
ModelState
.IsValid);
231
var error = Assert.Single(bindingContext.
ModelState
["theModelName"].Errors);
ModelBinding\Binders\FloatingPointTypeModelBinderTestOfT.cs (15)
69
Assert.False(bindingContext.
ModelState
.IsValid);
71
var error = Assert.Single(bindingContext.
ModelState
["theModelName"].Errors);
94
var error = Assert.Single(bindingContext.
ModelState
["theModelName"].Errors);
118
var error = Assert.Single(bindingContext.
ModelState
["theModelName"].Errors);
142
var error = Assert.Single(bindingContext.
ModelState
["theModelName"].Errors);
166
var error = Assert.Single(bindingContext.
ModelState
["theModelName"].Errors);
184
Assert.Empty(bindingContext.
ModelState
);
208
var error = Assert.Single(bindingContext.
ModelState
["theModelName"].Errors);
231
var entry = Assert.Single(bindingContext.
ModelState
);
253
Assert.True(bindingContext.
ModelState
.ContainsKey("theModelName"));
275
Assert.True(bindingContext.
ModelState
.ContainsKey("theModelName"));
296
Assert.True(bindingContext.
ModelState
.ContainsKey("theModelName"));
317
Assert.True(bindingContext.
ModelState
.ContainsKey("theModelName"));
338
Assert.True(bindingContext.
ModelState
.ContainsKey("theModelName"));
359
Assert.True(bindingContext.
ModelState
.ContainsKey("theModelName"));
ModelBinding\Binders\HeaderModelBinderTests.cs (2)
292
var entry = bindingContext.
ModelState
["someprefix.Header"];
316
var entry = bindingContext.
ModelState
["someprefix.Header"];
ModelBinding\Binders\KeyValuePairModelBinderTest.cs (7)
30
Assert.False(bindingContext.
ModelState
.IsValid);
32
var error = Assert.Single(bindingContext.
ModelState
["someName.Key"].Errors);
54
Assert.False(bindingContext.
ModelState
.IsValid);
56
var state = bindingContext.
ModelState
["someName.Value"];
80
Assert.True(bindingContext.
ModelState
.IsValid);
81
Assert.Equal(0, bindingContext.
ModelState
.ErrorCount);
139
Assert.Empty(bindingContext.
ModelState
);
ModelBinding\Binders\SimpleTypeModelBinderTest.cs (13)
34
Assert.True(bindingContext.
ModelState
.ContainsKey("theModelName"));
62
Assert.True(bindingContext.
ModelState
.ContainsKey("theModelName"));
129
var error = Assert.Single(bindingContext.
ModelState
["theModelName"].Errors);
153
Assert.False(bindingContext.
ModelState
.IsValid);
154
var error = Assert.Single(bindingContext.
ModelState
["theModelName"].Errors);
192
Assert.Empty(bindingContext.
ModelState
);
215
Assert.True(bindingContext.
ModelState
.ContainsKey("theModelName"));
236
Assert.True(bindingContext.
ModelState
.ContainsKey("theModelName"));
257
Assert.True(bindingContext.
ModelState
.ContainsKey("theModelName"));
282
Assert.True(bindingContext.
ModelState
.ContainsKey("theModelName"));
325
var entry = Assert.Single(bindingContext.
ModelState
);
353
Assert.True(bindingContext.
ModelState
.ContainsKey("theModelName"));
375
var error = Assert.Single(bindingContext.
ModelState
["theModelName"].Errors);
ModelBinding\Binders\TryParseTypeModelBinderTest.cs (12)
78
var error = Assert.Single(bindingContext.
ModelState
["theModelName"].Errors);
102
Assert.False(bindingContext.
ModelState
.IsValid);
103
var error = Assert.Single(bindingContext.
ModelState
["theModelName"].Errors);
141
Assert.Empty(bindingContext.
ModelState
);
163
Assert.True(bindingContext.
ModelState
.ContainsKey("theModelName"));
184
Assert.True(bindingContext.
ModelState
.ContainsKey("theModelName"));
209
Assert.True(bindingContext.
ModelState
.ContainsKey("theModelName"));
251
var entry = Assert.Single(bindingContext.
ModelState
);
279
Assert.True(bindingContext.
ModelState
.ContainsKey("theModelName"));
301
var error = Assert.Single(bindingContext.
ModelState
["theModelName"].Errors);
406
var error = Assert.Single(bindingContext.
ModelState
["theModelName"].Errors);
456
var error = Assert.Single(bindingContext.
ModelState
["theModelName"].Errors);