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