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