Base:
property
Result
Microsoft.AspNetCore.Mvc.ModelBinding.ModelBindingContext.Result
2 writes to Result
Microsoft.AspNetCore.Mvc.Core (1)
ModelBinding\DefaultModelBindingContext.cs (1)
297Result = default;
Microsoft.AspNetCore.Mvc.Core.Test (1)
Controllers\ControllerBinderDelegateProviderTest.cs (1)
1308mbc.Result = ModelBindingResult.Success(model);
287 references to Result
Microsoft.AspNetCore.Mvc.Core.Test (287)
ModelBinding\Binders\ArrayModelBinderTest.cs (9)
36Assert.True(bindingContext.Result.IsModelSet); 38var array = Assert.IsType<int[]>(bindingContext.Result.Model); 81Assert.Empty(Assert.IsType<string[]>(bindingContext.Result.Model)); 82Assert.True(bindingContext.Result.IsModelSet); 115Assert.Empty(Assert.IsType<string[]>(bindingContext.Result.Model)); 116Assert.True(bindingContext.Result.IsModelSet); 161Assert.False(bindingContext.Result.IsModelSet); 210Assert.True(bindingContext.Result.IsModelSet); 211Assert.Same(model, bindingContext.Result.Model);
ModelBinding\Binders\BinderTypeModelBinderTest.cs (2)
25Assert.False(bindingContext.Result.IsModelSet); 47var person = (Person)bindingContext.Result.Model;
ModelBinding\Binders\BodyModelBinderTests.cs (26)
48Assert.True(bindingContext.Result.IsModelSet); 66Assert.False(bindingContext.Result.IsModelSet); 67Assert.Null(bindingContext.Result.Model); 91Assert.False(bindingContext.Result.IsModelSet); 92Assert.Null(bindingContext.Result.Model); 115Assert.False(bindingContext.Result.IsModelSet); 148Assert.Null(bindingContext.Result.Model); 149Assert.False(bindingContext.Result.IsModelSet); 214Assert.True(bindingContext.Result.IsModelSet); 215Assert.Null(bindingContext.Result.Model); 271Assert.False(bindingContext.Result.IsModelSet); 272Assert.Null(bindingContext.Result.Model); 314Assert.False(bindingContext.Result.IsModelSet); 315Assert.Null(bindingContext.Result.Model); 345Assert.False(bindingContext.Result.IsModelSet); 346Assert.Null(bindingContext.Result.Model); 385Assert.False(bindingContext.Result.IsModelSet); 386Assert.Null(bindingContext.Result.Model); 416Assert.False(bindingContext.Result.IsModelSet); 417Assert.Null(bindingContext.Result.Model); 496Assert.False(bindingContext.Result.IsModelSet); 497Assert.Null(bindingContext.Result.Model); 552Assert.False(bindingContext.Result.IsModelSet); 553Assert.Null(bindingContext.Result.Model); 585Assert.True(bindingContext.Result.IsModelSet); 586Assert.Same(canReadFormatter1, bindingContext.Result.Model);
ModelBinding\Binders\ByteArrayModelBinderTests.cs (7)
28Assert.False(bindingContext.Result.IsModelSet); 29Assert.Null(bindingContext.Result.Model); 52Assert.True(bindingContext.Result.IsModelSet); 53var bytes = Assert.IsType<byte[]>(bindingContext.Result.Model); 75Assert.False(bindingContext.Result.IsModelSet); 97Assert.False(bindingContext.Result.IsModelSet); 98Assert.Null(bindingContext.Result.Model);
ModelBinding\Binders\CancellationTokenModelBinderTests.cs (2)
22Assert.True(bindingContext.Result.IsModelSet); 23Assert.Equal(bindingContext.HttpContext.RequestAborted, bindingContext.Result.Model);
ModelBinding\Binders\CollectionModelBinderTest.cs (19)
84Assert.True(bindingContext.Result.IsModelSet); 86var list = Assert.IsAssignableFrom<IList<int>>(bindingContext.Result.Model); 115Assert.True(bindingContext.Result.IsModelSet); 117Assert.Same(list, bindingContext.Result.Model); 141Assert.True(bindingContext.Result.IsModelSet); 143var list = Assert.IsAssignableFrom<IList<int>>(bindingContext.Result.Model); 167Assert.True(bindingContext.Result.IsModelSet); 169Assert.Same(list, bindingContext.Result.Model); 188Assert.True(bindingContext.Result.IsModelSet); 190var model = Assert.IsType<List<int>>(bindingContext.Result.Model); 267Assert.Empty(Assert.IsType<List<string>>(bindingContext.Result.Model)); 268Assert.True(bindingContext.Result.IsModelSet); 301Assert.Empty(Assert.IsType<List<string>>(bindingContext.Result.Model)); 302Assert.True(bindingContext.Result.IsModelSet); 342Assert.Null(bindingContext.Result.Model); 343Assert.False(bindingContext.Result.IsModelSet); 375Assert.Same(list, bindingContext.Result.Model); 377Assert.True(bindingContext.Result.IsModelSet); 417Assert.False(bindingContext.Result.IsModelSet);
ModelBinding\Binders\ComplexObjectModelBinderTest.cs (6)
313Assert.True(bindingContext.Result.IsModelSet); 314Assert.IsType<Person>(bindingContext.Result.Model); 357Assert.True(bindingContext.Result.IsModelSet); 358Assert.IsType<PersonWithNoProperties>(bindingContext.Result.Model); 401Assert.True(bindingContext.Result.IsModelSet); 402Assert.IsType<PersonWithAllPropertiesExcluded>(bindingContext.Result.Model);
ModelBinding\Binders\ComplexTypeModelBinderTest.cs (8)
326Assert.True(bindingContext.Result.IsModelSet); 329var returnedPerson = Assert.IsType<Person>(bindingContext.Result.Model); 373Assert.True(bindingContext.Result.IsModelSet); 374Assert.IsType<Person>(bindingContext.Result.Model); 417Assert.True(bindingContext.Result.IsModelSet); 418Assert.IsType<PersonWithNoProperties>(bindingContext.Result.Model); 461Assert.True(bindingContext.Result.IsModelSet); 462Assert.IsType<PersonWithAllPropertiesExcluded>(bindingContext.Result.Model);
ModelBinding\Binders\DateTimeModelBinderTest.cs (14)
26Assert.False(bindingContext.Result.IsModelSet); 45Assert.False(bindingContext.Result.IsModelSet); 46Assert.Null(bindingContext.Result.Model); 68Assert.False(bindingContext.Result.IsModelSet); 69Assert.Null(bindingContext.Result.Model); 87Assert.Equal(ModelBindingResult.Failed(), bindingContext.Result); 102Assert.Equal(ModelBindingResult.Failed(), bindingContext.Result); 124Assert.False(bindingContext.Result.IsModelSet); 125Assert.Null(bindingContext.Result.Model); 149Assert.Null(bindingContext.Result.Model); 172Assert.True(bindingContext.Result.IsModelSet); 173var model = Assert.IsType<DateTime>(bindingContext.Result.Model); 195Assert.True(bindingContext.Result.IsModelSet); 196var model = Assert.IsType<DateTime>(bindingContext.Result.Model);
ModelBinding\Binders\DictionaryModelBinderTest.cs (29)
43Assert.True(bindingContext.Result.IsModelSet); 45var dictionary = Assert.IsAssignableFrom<IDictionary<int, string>>(bindingContext.Result.Model); 52Assert.DoesNotContain(bindingContext.Result.Model, bindingContext.ValidationState.Keys); 84Assert.True(bindingContext.Result.IsModelSet); 86Assert.Same(dictionary, bindingContext.Result.Model); 93Assert.DoesNotContain(bindingContext.Result.Model, bindingContext.ValidationState.Keys); 151Assert.True(bindingContext.Result.IsModelSet); 153var resultDictionary = Assert.IsAssignableFrom<IDictionary<string, string>>(bindingContext.Result.Model); 185Assert.True(bindingContext.Result.IsModelSet); 187var resultDictionary = Assert.IsAssignableFrom<IDictionary<string, string>>(bindingContext.Result.Model); 222Assert.True(bindingContext.Result.IsModelSet); 224var resultDictionary = Assert.IsAssignableFrom<IDictionary<string, string>>(bindingContext.Result.Model); 260Assert.False(bindingContext.Result.IsModelSet); 261Assert.Null(bindingContext.Result.Model); 309Assert.True(bindingContext.Result.IsModelSet); 311var resultDictionary = Assert.IsAssignableFrom<IDictionary<long, int>>(bindingContext.Result.Model); 359Assert.True(bindingContext.Result.IsModelSet); 361var resultDictionary = Assert.IsAssignableFrom<IDictionary<int, ModelWithProperties>>(bindingContext.Result.Model); 365Assert.Contains(bindingContext.Result.Model, bindingContext.ValidationState.Keys); 366var entry = bindingContext.ValidationState[bindingContext.Result.Model]; 406Assert.True(bindingContext.Result.IsModelSet); 408var resultDictionary = Assert.IsAssignableFrom<SortedDictionary<string, string>>(bindingContext.Result.Model); 452Assert.Empty(Assert.IsType<Dictionary<string, string>>(bindingContext.Result.Model)); 453Assert.True(bindingContext.Result.IsModelSet); 487Assert.Empty(Assert.IsType<Dictionary<string, string>>(bindingContext.Result.Model)); 488Assert.True(bindingContext.Result.IsModelSet); 536Assert.Null(bindingContext.Result.Model); 537Assert.False(bindingContext.Result.IsModelSet); 581Assert.False(bindingContext.Result.IsModelSet);
ModelBinding\Binders\EnumTypeModelBinderTest.cs (18)
23Assert.True(bindingContext.Result.IsModelSet); 24Assert.Null(bindingContext.Result.Model); 40Assert.False(bindingContext.Result.IsModelSet); 41Assert.Null(bindingContext.Result.Model); 62Assert.True(bindingContext.Result.IsModelSet); 63var boundModel = Assert.IsType<IntEnum>(bindingContext.Result.Model); 86Assert.True(bindingContext.Result.IsModelSet); 87var boundModel = Assert.IsType<FlagsEnum>(bindingContext.Result.Model); 110Assert.True(bindingContext.Result.IsModelSet); 111var boundModel = Assert.IsType<FlagsEnum>(bindingContext.Result.Model); 145Assert.False(bindingContext.Result.IsModelSet); 146Assert.Null(bindingContext.Result.Model); 172Assert.True(bindingContext.Result.IsModelSet); 173var boundModel = Assert.IsType<FlagsEnum>(bindingContext.Result.Model); 197Assert.True(bindingContext.Result.IsModelSet); 198var boundModel = Assert.IsType<FlagsEnum>(bindingContext.Result.Model); 228Assert.False(bindingContext.Result.IsModelSet); 229Assert.Null(bindingContext.Result.Model);
ModelBinding\Binders\FloatingPointTypeModelBinderTestOfT.cs (27)
47Assert.False(bindingContext.Result.IsModelSet); 67Assert.False(bindingContext.Result.IsModelSet); 68Assert.Null(bindingContext.Result.Model); 91Assert.False(bindingContext.Result.IsModelSet); 92Assert.Null(bindingContext.Result.Model); 115Assert.False(bindingContext.Result.IsModelSet); 116Assert.Null(bindingContext.Result.Model); 139Assert.False(bindingContext.Result.IsModelSet); 140Assert.Null(bindingContext.Result.Model); 163Assert.False(bindingContext.Result.IsModelSet); 164Assert.Null(bindingContext.Result.Model); 183Assert.Equal(ModelBindingResult.Failed(), bindingContext.Result); 205Assert.False(bindingContext.Result.IsModelSet); 206Assert.Null(bindingContext.Result.Model); 230Assert.Null(bindingContext.Result.Model); 251Assert.True(bindingContext.Result.IsModelSet); 252Assert.Equal(Twelve, bindingContext.Result.Model); 273Assert.True(bindingContext.Result.IsModelSet); 274Assert.Equal(TwelvePointFive, bindingContext.Result.Model); 294Assert.True(bindingContext.Result.IsModelSet); 295Assert.Equal(TwelvePointFive, bindingContext.Result.Model); 315Assert.True(bindingContext.Result.IsModelSet); 316Assert.Equal(ThirtyTwoThousand, bindingContext.Result.Model); 336Assert.True(bindingContext.Result.IsModelSet); 337Assert.Equal(ThirtyTwoThousandPointOne, bindingContext.Result.Model); 357Assert.True(bindingContext.Result.IsModelSet); 358Assert.Equal(ThirtyTwoThousandPointOne, bindingContext.Result.Model);
ModelBinding\Binders\FormCollectionModelBinderTest.cs (4)
31Assert.True(bindingContext.Result.IsModelSet); 34var form = Assert.IsAssignableFrom<IFormCollection>(bindingContext.Result.Model); 52Assert.True(bindingContext.Result.IsModelSet); 53var form = Assert.IsAssignableFrom<IFormCollection>(bindingContext.Result.Model);
ModelBinding\Binders\FormFileModelBinderTest.cs (24)
29Assert.True(bindingContext.Result.IsModelSet); 31var entry = bindingContext.ValidationState[bindingContext.Result.Model]; 236Assert.True(bindingContext.Result.IsModelSet); 238var entry = bindingContext.ValidationState[bindingContext.Result.Model]; 243var files = Assert.IsAssignableFrom<IList<IFormFile>>(bindingContext.Result.Model); 268Assert.True(bindingContext.Result.IsModelSet); 269Assert.IsAssignableFrom(destinationType, bindingContext.Result.Model); 270Assert.Equal(formFiles, bindingContext.Result.Model as IEnumerable<IFormFile>); 286Assert.True(bindingContext.Result.IsModelSet); 287var file = Assert.IsAssignableFrom<IFormFile>(bindingContext.Result.Model); 304Assert.False(bindingContext.Result.IsModelSet); 305Assert.Null(bindingContext.Result.Model); 324Assert.False(bindingContext.Result.IsModelSet); 325Assert.Null(bindingContext.Result.Model); 352Assert.True(bindingContext.Result.IsModelSet); 353var file = Assert.IsAssignableFrom<IFormFile>(bindingContext.Result.Model); 374Assert.False(bindingContext.Result.IsModelSet); 375Assert.Null(bindingContext.Result.Model); 394Assert.False(bindingContext.Result.IsModelSet); 395Assert.Null(bindingContext.Result.Model); 411Assert.True(bindingContext.Result.IsModelSet); 412Assert.NotNull(bindingContext.Result.Model); 428Assert.False(bindingContext.Result.IsModelSet); 429Assert.Null(bindingContext.Result.Model);
ModelBinding\Binders\HeaderModelBinderTests.cs (24)
34Assert.True(bindingContext.Result.IsModelSet); 35Assert.Equal(headerValue.Split(','), bindingContext.Result.Model); 56Assert.True(bindingContext.Result.IsModelSet); 57Assert.Equal(headerValue, bindingContext.Result.Model); 83Assert.True(bindingContext.Result.IsModelSet); 84Assert.IsAssignableFrom(destinationType, bindingContext.Result.Model); 85Assert.Equal(headerValue.Split(','), bindingContext.Result.Model as IEnumerable<string>); 102Assert.True(bindingContext.Result.IsModelSet); 103Assert.Equal(headerValue.Split(','), bindingContext.Result.Model); 153Assert.True(bindingContext.Result.IsModelSet); 154Assert.Equal(expectedModel, bindingContext.Result.Model); 170Assert.False(bindingContext.Result.IsModelSet); 171Assert.Null(bindingContext.Result.Model); 189Assert.False(bindingContext.Result.IsModelSet); 190Assert.Null(bindingContext.Result.Model); 212Assert.True(bindingContext.Result.IsModelSet); 213Assert.IsAssignableFrom(destinationType, bindingContext.Result.Model); 214Assert.Equal(headerValue.Split(','), bindingContext.Result.Model as IEnumerable<string>); 229Assert.True(bindingContext.Result.IsModelSet); 230Assert.NotNull(bindingContext.Result.Model); 246Assert.True(bindingContext.Result.IsModelSet); 247Assert.Equal("application/json,text/json", bindingContext.Result.Model); 270Assert.True(bindingContext.Result.IsModelSet); 271Assert.Equal("application/json,text/json", bindingContext.Result.Model);
ModelBinding\Binders\KeyValuePairModelBinderTest.cs (9)
28Assert.False(bindingContext.Result.IsModelSet); 29Assert.Null(bindingContext.Result.Model); 53Assert.Null(bindingContext.Result.Model); 79Assert.False(bindingContext.Result.IsModelSet); 100Assert.True(bindingContext.Result.IsModelSet); 101Assert.Equal(new KeyValuePair<int, string>(42, "some-value"), bindingContext.Result.Model); 166var model = Assert.IsType<KeyValuePair<string, string>>(bindingContext.Result.Model); 168Assert.True(bindingContext.Result.IsModelSet); 196Assert.False(bindingContext.Result.IsModelSet);
ModelBinding\Binders\ServicesModelBinderTest.cs (2)
25Assert.True(bindingContext.Result.IsModelSet); 27var entry = bindingContext.ValidationState[bindingContext.Result.Model];
ModelBinding\Binders\SimpleTypeModelBinderTest.cs (28)
33Assert.Same(value, bindingContext.Result.Model); 61Assert.Same(value, bindingContext.Result.Model); 107Assert.False(bindingContext.Result.IsModelSet); 126Assert.False(bindingContext.Result.IsModelSet); 127Assert.Null(bindingContext.Result.Model); 151Assert.False(bindingContext.Result.IsModelSet); 152Assert.Null(bindingContext.Result.Model); 191Assert.Equal(ModelBindingResult.Failed(), bindingContext.Result); 214Assert.Null(bindingContext.Result.Model); 234Assert.True(bindingContext.Result.IsModelSet); 235Assert.Equal(12, bindingContext.Result.Model); 255Assert.True(bindingContext.Result.IsModelSet); 256Assert.Equal(12.5, bindingContext.Result.Model); 280Assert.True(bindingContext.Result.IsModelSet); 281Assert.Equal(42, bindingContext.Result.Model); 323Assert.False(bindingContext.Result.IsModelSet); 351Assert.True(bindingContext.Result.IsModelSet); 352Assert.Equal(12.5M, bindingContext.Result.Model); 372Assert.False(bindingContext.Result.IsModelSet); 373Assert.Null(bindingContext.Result.Model); 396Assert.True(bindingContext.Result.IsModelSet); 397var boundModel = Assert.IsType<IntEnum>(bindingContext.Result.Model); 417Assert.True(bindingContext.Result.IsModelSet); 418var boundModel = Assert.IsType<IntEnum>(bindingContext.Result.Model); 458Assert.True(bindingContext.Result.IsModelSet); 459var boundModel = Assert.IsType<IntEnum>(bindingContext.Result.Model); 481Assert.True(bindingContext.Result.IsModelSet); 482var boundModel = Assert.IsType<FlagsEnum>(bindingContext.Result.Model);
ModelBinding\Binders\TryParseTypeModelBinderTest.cs (29)
56Assert.False(bindingContext.Result.IsModelSet); 75Assert.False(bindingContext.Result.IsModelSet); 76Assert.Null(bindingContext.Result.Model); 100Assert.False(bindingContext.Result.IsModelSet); 101Assert.Null(bindingContext.Result.Model); 140Assert.Equal(ModelBindingResult.Failed(), bindingContext.Result); 161Assert.True(bindingContext.Result.IsModelSet); 162Assert.Equal(12, bindingContext.Result.Model); 182Assert.True(bindingContext.Result.IsModelSet); 183Assert.Equal(12.5, bindingContext.Result.Model); 207Assert.True(bindingContext.Result.IsModelSet); 208Assert.Equal(42, bindingContext.Result.Model); 249Assert.False(bindingContext.Result.IsModelSet); 277Assert.True(bindingContext.Result.IsModelSet); 278Assert.Equal(12.5M, bindingContext.Result.Model); 298Assert.False(bindingContext.Result.IsModelSet); 299Assert.Null(bindingContext.Result.Model); 322Assert.True(bindingContext.Result.IsModelSet); 323var boundModel = Assert.IsType<IntEnum>(bindingContext.Result.Model); 343Assert.True(bindingContext.Result.IsModelSet); 344var boundModel = Assert.IsType<IntEnum>(bindingContext.Result.Model); 380Assert.True(bindingContext.Result.IsModelSet); 381var boundModel = Assert.IsType<IntEnum>(bindingContext.Result.Model); 405Assert.False(bindingContext.Result.IsModelSet); 430Assert.True(bindingContext.Result.IsModelSet); 431var boundModel = Assert.IsType<TestTryParseClass>(bindingContext.Result.Model); 455Assert.False(bindingContext.Result.IsModelSet); 479Assert.True(bindingContext.Result.IsModelSet); 480var boundModel = Assert.IsType<FlagsEnum>(bindingContext.Result.Model);