45 references to ModelType
Microsoft.AspNetCore.Mvc.Core (36)
ModelBinding\Binders\CollectionModelBinder.cs (3)
122
model = CreateEmptyCollection(bindingContext.
ModelType
);
160
model = ConvertToCollectionType(bindingContext.
ModelType
, boundCollection);
501
var enumerableType = ClosedGenericMatcher.ExtractGenericInterface(bindingContext.
ModelType
, typeof(IEnumerable<>));
ModelBinding\Binders\ComplexObjectModelBinder.cs (5)
177
/// <returns>An <see cref="object"/> compatible with <see cref="ModelBindingContext.
ModelType
"/>.</returns>
190
var modelType = bindingContext.
ModelType
;
215
.Lambda<Func<object>>(Expression.New(bindingContext.
ModelType
))
742
NoPublicSettableItems(logger, bindingContext.ModelName, bindingContext.
ModelType
);
746
=> CannotBindToComplexType(logger, bindingContext.
ModelType
);
ModelBinding\Binders\ComplexTypeModelBinder.cs (5)
458
/// <returns>An <see cref="object"/> compatible with <see cref="ModelBindingContext.
ModelType
"/>.</returns>
471
var modelType = bindingContext.
ModelType
;
504
.Lambda<Func<object>>(Expression.New(bindingContext.
ModelType
))
575
=> NoPublicSettableProperties(logger, bindingContext.ModelName, bindingContext.
ModelType
);
581
=> CannotBindToComplexType(logger, bindingContext.
ModelType
);
ModelBinding\Binders\DictionaryModelBinder.cs (1)
157
var model = (IDictionary<TKey, TValue?>)(result.Model ?? CreateEmptyCollection(bindingContext.
ModelType
));
ModelBinding\Binders\FormFileModelBinder.cs (3)
40
var createFileCollection = bindingContext.
ModelType
== typeof(IFormFileCollection);
80
if (bindingContext.
ModelType
== typeof(IFormFile))
102
var modelType = bindingContext.
ModelType
;
ModelBinding\Binders\HeaderModelBinder.cs (2)
128
if (bindingContext.
ModelType
== typeof(string))
173
if (bindingContext.
ModelType
.IsAssignableFrom(typeof(string[])))
ModelBinding\Binders\KeyedServicesModelBinder.cs (2)
32
keyedServices.GetKeyedService(bindingContext.
ModelType
, _key) :
33
keyedServices.GetRequiredKeyedService(bindingContext.
ModelType
, _key);
ModelBinding\Binders\ServicesModelBinder.cs (2)
26
requestServices.GetService(bindingContext.
ModelType
) :
27
requestServices.GetRequiredService(bindingContext.
ModelType
);
ModelBinding\Binders\SimpleTypeModelBinder.cs (1)
60
if (bindingContext.
ModelType
== typeof(string))
ModelBinding\ModelBindingHelper.cs (6)
461
var modelType = bindingContext.
ModelType
;
505
/// <see cref="ModelBindingContext.
ModelType
"/>.
511
/// <see cref="ModelBindingContext.
ModelType
"/>.
523
/// <see cref="ModelBindingContext.
ModelType
"/>.
532
/// <see cref="ModelBindingContext.
ModelType
"/>.
545
var modelType = bindingContext.
ModelType
;
MvcCoreLoggerExtensions.cs (6)
128
bindingContext.
ModelType
);
136
bindingContext.
ModelType
);
142
bindingContext.
ModelType
);
161
=> CannotBindToFilesCollectionDueToUnsupportedContentType(logger, bindingContext.ModelName, bindingContext.
ModelType
);
194
AttemptingToBindModel(logger, bindingContext.
ModelType
, bindingContext.ModelName);
232
DoneAttemptingToBindModel(logger, bindingContext.
ModelType
, bindingContext.ModelName);
Microsoft.AspNetCore.Mvc.Core.Test (5)
ModelBinding\Binders\BodyModelBinderTests.cs (1)
652
$"To use model binding, remove the [FromBody] attribute from the property or parameter named '{bindingContext.ModelName}' with model type '{bindingContext.
ModelType
}'.", write.State.ToString()),
ModelBinding\Binders\CollectionModelBinderTest.cs (1)
517
var model = ModelBindingHelper.ConvertTo(valueToConvert, context.
ModelType
, value.Culture);
ModelBinding\Binders\KeyValuePairModelBinderTest.cs (2)
232
if (mbc.
ModelType
== typeof(int) && success)
246
if (mbc.
ModelType
== typeof(string) && success)
ModelBinding\DefaultModelBindingContextTest.cs (1)
152
Assert.Equal(typeof(int), bindingContext.
ModelType
);
Microsoft.AspNetCore.Mvc.IntegrationTests (4)
ActionParametersIntegrationTest.cs (1)
1076
Assert.Equal(typeof(ClassWithNoDefaultConstructor), bindingContext.
ModelType
);
BinderTypeBasedModelBinderIntegrationTest.cs (2)
324
if (bindingContext.
ModelType
!= typeof(Address))
349
if (bindingContext.
ModelType
!= typeof(Address3))
SuccessfulModelBinder.cs (1)
15
var model = bindingContext.
ModelType
== typeof(bool) ? (object)true : null;