45 references to ModelType
Microsoft.AspNetCore.Mvc.Core (36)
ModelBinding\Binders\CollectionModelBinder.cs (3)
122model = CreateEmptyCollection(bindingContext.ModelType); 160model = ConvertToCollectionType(bindingContext.ModelType, boundCollection); 501var 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> 190var modelType = bindingContext.ModelType; 215.Lambda<Func<object>>(Expression.New(bindingContext.ModelType)) 742NoPublicSettableItems(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> 471var 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)
157var model = (IDictionary<TKey, TValue?>)(result.Model ?? CreateEmptyCollection(bindingContext.ModelType));
ModelBinding\Binders\FormFileModelBinder.cs (3)
40var createFileCollection = bindingContext.ModelType == typeof(IFormFileCollection); 80if (bindingContext.ModelType == typeof(IFormFile)) 102var modelType = bindingContext.ModelType;
ModelBinding\Binders\HeaderModelBinder.cs (2)
128if (bindingContext.ModelType == typeof(string)) 173if (bindingContext.ModelType.IsAssignableFrom(typeof(string[])))
ModelBinding\Binders\KeyedServicesModelBinder.cs (2)
32keyedServices.GetKeyedService(bindingContext.ModelType, _key) : 33keyedServices.GetRequiredKeyedService(bindingContext.ModelType, _key);
ModelBinding\Binders\ServicesModelBinder.cs (2)
26requestServices.GetService(bindingContext.ModelType) : 27requestServices.GetRequiredService(bindingContext.ModelType);
ModelBinding\Binders\SimpleTypeModelBinder.cs (1)
60if (bindingContext.ModelType == typeof(string))
ModelBinding\ModelBindingHelper.cs (6)
461var modelType = bindingContext.ModelType; 505/// <see cref="ModelBindingContext.ModelType"/>. 511/// <see cref="ModelBindingContext.ModelType"/>. 523/// <see cref="ModelBindingContext.ModelType"/>. 532/// <see cref="ModelBindingContext.ModelType"/>. 545var modelType = bindingContext.ModelType;
MvcCoreLoggerExtensions.cs (6)
128bindingContext.ModelType); 136bindingContext.ModelType); 142bindingContext.ModelType); 161=> CannotBindToFilesCollectionDueToUnsupportedContentType(logger, bindingContext.ModelName, bindingContext.ModelType); 194AttemptingToBindModel(logger, bindingContext.ModelType, bindingContext.ModelName); 232DoneAttemptingToBindModel(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)
517var model = ModelBindingHelper.ConvertTo(valueToConvert, context.ModelType, value.Culture);
ModelBinding\Binders\KeyValuePairModelBinderTest.cs (2)
232if (mbc.ModelType == typeof(int) && success) 246if (mbc.ModelType == typeof(string) && success)
ModelBinding\DefaultModelBindingContextTest.cs (1)
152Assert.Equal(typeof(int), bindingContext.ModelType);
Microsoft.AspNetCore.Mvc.IntegrationTests (4)
ActionParametersIntegrationTest.cs (1)
1076Assert.Equal(typeof(ClassWithNoDefaultConstructor), bindingContext.ModelType);
BinderTypeBasedModelBinderIntegrationTest.cs (2)
324if (bindingContext.ModelType != typeof(Address)) 349if (bindingContext.ModelType != typeof(Address3))
SuccessfulModelBinder.cs (1)
15var model = bindingContext.ModelType == typeof(bool) ? (object)true : null;