1 type derived from ModelBindingContext
Microsoft.AspNetCore.Mvc.Core (1)
ModelBinding\DefaultModelBindingContext.cs (1)
16public class DefaultModelBindingContext : ModelBindingContext
157 references to ModelBindingContext
BasicWebSite (2)
Controllers\BindPropertiesController.cs (1)
29public Task BindModelAsync(ModelBindingContext bindingContext)
Controllers\ContactApiController.cs (1)
145public Task BindModelAsync(ModelBindingContext bindingContext)
FormatterWebSite (1)
PolymorphicBinder.cs (1)
11public Task BindModelAsync(ModelBindingContext bindingContext)
Microsoft.AspNetCore.Mvc.Abstractions (8)
ModelBinding\IModelBinder.cs (4)
14/// <param name="bindingContext">The <see cref="ModelBindingContext"/>.</param> 20/// If model binding was successful, the <see cref="ModelBindingContext.Result"/> should have 24/// A model binder that completes successfully should set <see cref="ModelBindingContext.Result"/> to 28Task BindModelAsync(ModelBindingContext bindingContext);
ModelBinding\ModelBindingContext.cs (4)
162/// the <see cref="ModelBindingContext"/>. 166private readonly ModelBindingContext _context; 169/// Initializes the <see cref="NestedScope"/> for a <see cref="ModelBindingContext"/>. 172public NestedScope(ModelBindingContext context)
Microsoft.AspNetCore.Mvc.Core (99)
ModelBinding\Binders\BinderTypeModelBinder.cs (1)
40public async Task BindModelAsync(ModelBindingContext bindingContext)
ModelBinding\Binders\BodyModelBinder.cs (1)
87public async Task BindModelAsync(ModelBindingContext bindingContext)
ModelBinding\Binders\ByteArrayModelBinder.cs (1)
29public Task BindModelAsync(ModelBindingContext bindingContext)
ModelBinding\Binders\CancellationTokenModelBinder.cs (1)
16public Task BindModelAsync(ModelBindingContext bindingContext)
ModelBinding\Binders\CollectionModelBinder.cs (10)
105public virtual async Task BindModelAsync(ModelBindingContext bindingContext) 205/// Add a <see cref="ModelError" /> to <see cref="ModelBindingContext.ModelState" /> if 208/// <param name="bindingContext">The <see cref="ModelBindingContext"/>.</param> 210/// For back-compatibility reasons, <see cref="ModelBindingContext.Result" /> must have 215protected void AddErrorIfBindingRequired(ModelBindingContext bindingContext) 264ModelBindingContext bindingContext, 302private Task<CollectionResult> BindComplexCollection(ModelBindingContext bindingContext) 323ModelBindingContext bindingContext, 492public static void AttemptingToBindCollectionUsingIndices(ILogger logger, ModelBindingContext bindingContext) 533public static void NoNonIndexBasedFormatFoundForCollection(ILogger logger, ModelBindingContext bindingContext)
ModelBinding\Binders\ComplexObjectModelBinder.cs (17)
49public Task BindModelAsync(ModelBindingContext bindingContext) 66private async Task BindModelCoreAsync(ModelBindingContext bindingContext, int propertyData) 158internal static bool CreateModel(ModelBindingContext bindingContext, ModelMetadata boundConstructor, object[] values) 176/// <param name="bindingContext">The <see cref="ModelBindingContext"/>.</param> 177/// <returns>An <see cref="object"/> compatible with <see cref="ModelBindingContext.ModelType"/>.</returns> 178internal void CreateModel(ModelBindingContext bindingContext) 223ModelBindingContext bindingContext, 320ModelBindingContext bindingContext, 406internal static bool CanBindItem(ModelBindingContext bindingContext, ModelMetadata propertyMetadata) 434ModelBindingContext bindingContext, 479ModelBindingContext bindingContext, 507internal int CanCreateModel(ModelBindingContext bindingContext) 540private int CanBindAnyModelItem(ModelBindingContext bindingContext) 685ModelBindingContext bindingContext, 717ModelBindingContext bindingContext) 740public static void NoPublicSettableItems(ILogger logger, ModelBindingContext bindingContext) 745public static void CannotBindToComplexType(ILogger logger, ModelBindingContext bindingContext)
ModelBinding\Binders\ComplexTypeModelBinder.cs (19)
78public Task BindModelAsync(ModelBindingContext bindingContext) 95private async Task BindModelCoreAsync(ModelBindingContext bindingContext, int propertyData) 227/// <param name="bindingContext">The <see cref="ModelBindingContext"/> for the container model.</param> 230protected virtual bool CanBindProperty(ModelBindingContext bindingContext, ModelMetadata propertyMetadata) 257ModelBindingContext bindingContext, 301/// <param name="bindingContext">The <see cref="ModelBindingContext"/> for the model property.</param> 303/// A <see cref="Task"/> that when completed will set <see cref="ModelBindingContext.Result"/> to the 306protected virtual Task BindProperty(ModelBindingContext bindingContext) 312internal int CanCreateModel(ModelBindingContext bindingContext) 345private int CanBindAnyModelProperties(ModelBindingContext bindingContext) 457/// <param name="bindingContext">The <see cref="ModelBindingContext"/>.</param> 458/// <returns>An <see cref="object"/> compatible with <see cref="ModelBindingContext.ModelType"/>.</returns> 459protected virtual object CreateModel(ModelBindingContext bindingContext) 512/// Updates a property in the current <see cref="ModelBindingContext.Model"/>. 514/// <param name="bindingContext">The <see cref="ModelBindingContext"/>.</param> 519ModelBindingContext bindingContext, 555ModelBindingContext bindingContext) 574public static void NoPublicSettableProperties(ILogger logger, ModelBindingContext bindingContext) 580public static void CannotBindToComplexType(ILogger logger, ModelBindingContext bindingContext)
ModelBinding\Binders\DateTimeModelBinder.cs (1)
33public Task BindModelAsync(ModelBindingContext bindingContext)
ModelBinding\Binders\DecimalModelBinder.cs (1)
35public Task BindModelAsync(ModelBindingContext bindingContext)
ModelBinding\Binders\DictionaryModelBinder.cs (2)
110public override async Task BindModelAsync(ModelBindingContext bindingContext) 265public static void NoKeyValueFormatForDictionaryModelBinder(ILogger logger, ModelBindingContext bindingContext)
ModelBinding\Binders\DoubleModelBinder.cs (1)
35public Task BindModelAsync(ModelBindingContext bindingContext)
ModelBinding\Binders\EnumTypeModelBinder.cs (2)
37ModelBindingContext bindingContext, 58private static bool IsDefinedInEnum(object model, ModelBindingContext bindingContext)
ModelBinding\Binders\FloatModelBinder.cs (1)
35public Task BindModelAsync(ModelBindingContext bindingContext)
ModelBinding\Binders\FormCollectionModelBinder.cs (1)
33public async Task BindModelAsync(ModelBindingContext bindingContext)
ModelBinding\Binders\FormFileModelBinder.cs (2)
34public async Task BindModelAsync(ModelBindingContext bindingContext) 137ModelBindingContext bindingContext,
ModelBinding\Binders\HeaderModelBinder.cs (4)
49public async Task BindModelAsync(ModelBindingContext bindingContext) 100private static HeaderValueProvider GetHeaderValueProvider(string headerName, ModelBindingContext bindingContext) 122private void BindWithoutInnerBinder(ModelBindingContext bindingContext) 165private static object? GetCompatibleCollection(ModelBindingContext bindingContext, string[] values)
ModelBinding\Binders\KeyedServicesModelBinder.cs (1)
22public Task BindModelAsync(ModelBindingContext bindingContext)
ModelBinding\Binders\KeyValuePairModelBinder.cs (2)
39public async Task BindModelAsync(ModelBindingContext bindingContext) 91ModelBindingContext bindingContext,
ModelBinding\Binders\ServicesModelBinder.cs (1)
20public Task BindModelAsync(ModelBindingContext bindingContext)
ModelBinding\Binders\SimpleTypeModelBinder.cs (2)
35public Task BindModelAsync(ModelBindingContext bindingContext) 113ModelBindingContext bindingContext,
ModelBinding\Binders\TryParseModelBinder.cs (7)
19private static readonly ParameterExpression BindingContextExpression = Expression.Parameter(typeof(ModelBindingContext), "bindingContext"); 21private static readonly MemberExpression BindingResultExpression = Expression.Property(BindingContextExpression, nameof(ModelBindingContext.Result)); 25private readonly Func<ValueProviderResult, ModelBindingContext, object?> _tryParseOperation; 43public Task BindModelAsync(ModelBindingContext bindingContext) 98private static void AddModelError(ModelBindingContext bindingContext, Exception exception) 107private static Func<ValueProviderResult, ModelBindingContext, object?> CreateTryParseOperation(Type modelType) 139return Expression.Lambda<Func<ValueProviderResult, ModelBindingContext, object?>>(expression, new[] { ValueProviderResultExpression, BindingContextExpression }).Compile();
ModelBinding\DefaultModelBindingContext.cs (1)
197public static ModelBindingContext CreateBindingContext(
ModelBinding\ModelBindingHelper.cs (12)
241var modelBindingContext = DefaultModelBindingContext.CreateBindingContext( 452/// <param name="bindingContext">The <see cref="ModelBindingContext"/>.</param> 458public static bool CanGetCompatibleCollection<T>(ModelBindingContext bindingContext) 505/// <see cref="ModelBindingContext.ModelType"/>. 508/// <param name="bindingContext">The <see cref="ModelBindingContext"/>.</param> 511/// <see cref="ModelBindingContext.ModelType"/>. 516public static ICollection<T> GetCompatibleCollection<T>(ModelBindingContext bindingContext) 523/// <see cref="ModelBindingContext.ModelType"/>. 526/// <param name="bindingContext">The <see cref="ModelBindingContext"/>.</param> 532/// <see cref="ModelBindingContext.ModelType"/>. 537public static ICollection<T> GetCompatibleCollection<T>(ModelBindingContext bindingContext, int capacity) 542private static ICollection<T> GetCompatibleCollection<T>(ModelBindingContext bindingContext, int? capacity)
ModelBinding\NoOpBinder.cs (1)
12public Task BindModelAsync(ModelBindingContext bindingContext)
ModelBinding\ParameterBinder.cs (2)
107var modelBindingContext = DefaultModelBindingContext.CreateBindingContext( 176ModelBindingContext modelBindingContext,
ModelBinding\PlaceholderBinder.cs (1)
18public Task BindModelAsync(ModelBindingContext bindingContext)
MvcCoreLoggerExtensions.cs (4)
113public static void FoundNoValueInRequest(this ILogger logger, ModelBindingContext bindingContext) 160public static void CannotBindToFilesCollectionDueToUnsupportedContentType(this ILogger logger, ModelBindingContext bindingContext) 168public static void AttemptingToBindModel(this ILogger logger, ModelBindingContext bindingContext) 208public static void DoneAttemptingToBindModel(this ILogger logger, ModelBindingContext bindingContext)
Microsoft.AspNetCore.Mvc.Core.Test (35)
ApplicationModels\InferParameterBindingInfoConventionTest.cs (1)
1153public Task BindModelAsync(ModelBindingContext bindingContext)
Controllers\ControllerBinderDelegateProviderTest.cs (3)
242.Callback((ModelBindingContext context) => 320It.Is<ModelBindingContext>(context => context.ModelMetadata == modelMetadata.Object)), 368It.Is<ModelBindingContext>(context => context.ModelMetadata == modelMetadata.Object)),
ModelBinding\Binders\BinderTypeModelBinderProviderTest.cs (1)
48public Task BindModelAsync(ModelBindingContext bindingContext)
ModelBinding\Binders\BinderTypeModelBinderTest.cs (2)
97public Task BindModelAsync(ModelBindingContext bindingContext) 112public Task BindModelAsync(ModelBindingContext bindingContext)
ModelBinding\Binders\ComplexObjectModelBinderTest.cs (1)
638public Task BindModelAsync(ModelBindingContext bindingContext)
ModelBinding\Binders\ComplexTypeModelBinderTest.cs (9)
603.Setup(b => b.CreateModelPublic(It.IsAny<ModelBindingContext>())) 1626public virtual Task BindPropertyPublic(ModelBindingContext bindingContext) 1641protected override Task BindProperty(ModelBindingContext bindingContext) 1647ModelBindingContext bindingContext, 1661ModelBindingContext bindingContext, 1667public virtual object CreateModelPublic(ModelBindingContext bindingContext) 1672protected override object CreateModel(ModelBindingContext bindingContext) 1678ModelBindingContext bindingContext, 1687ModelBindingContext bindingContext,
ModelBinding\Binders\FormFileModelBinderTest.cs (5)
51var bindingContext = DefaultModelBindingContext.CreateBindingContext( 89var bindingContext = DefaultModelBindingContext.CreateBindingContext( 131var bindingContext = DefaultModelBindingContext.CreateBindingContext( 166var bindingContext = DefaultModelBindingContext.CreateBindingContext( 202var bindingContext = DefaultModelBindingContext.CreateBindingContext(
ModelBinding\DefaultModelBindingContextTest.cs (4)
72var context = DefaultModelBindingContext.CreateBindingContext( 95var context = DefaultModelBindingContext.CreateBindingContext( 124var context = DefaultModelBindingContext.CreateBindingContext( 186public Task BindModelAsync(ModelBindingContext bindingContext)
ModelBinding\ModelBinderFactoryTest.cs (2)
653public Task BindModelAsync(ModelBindingContext bindingContext) 665public Task BindModelAsync(ModelBindingContext bindingContext)
ModelBinding\ParameterBinderTest.cs (2)
731.Setup(o => o.BindModelAsync(It.IsAny<ModelBindingContext>())) 732.Returns<ModelBindingContext>(context =>
ModelBinding\StubModelBinder.cs (5)
10private readonly Func<ModelBindingContext, Task> _callback; 26public StubModelBinder(Action<ModelBindingContext> callback) 35public StubModelBinder(Func<ModelBindingContext, ModelBindingResult> callback) 45public StubModelBinder(Func<ModelBindingContext, Task<ModelBindingResult>> callback) 58public virtual async Task BindModelAsync(ModelBindingContext bindingContext)
Microsoft.AspNetCore.Mvc.IntegrationTests (10)
ActionParametersIntegrationTest.cs (1)
1074protected override object CreateModel(ModelBindingContext bindingContext)
BinderTypeBasedModelBinderIntegrationTest.cs (5)
318public Task BindModelAsync(ModelBindingContext bindingContext) 343public Task BindModelAsync(ModelBindingContext bindingContext) 368public Task BindModelAsync(ModelBindingContext bindingContext) 386public Task BindModelAsync(ModelBindingContext bindingContext) 398public Task BindModelAsync(ModelBindingContext bindingContext)
ComplexRecordIntegrationTest.cs (1)
3033public Task BindModelAsync(ModelBindingContext bindingContext)
ComplexTypeIntegrationTestBase.cs (1)
3248public Task BindModelAsync(ModelBindingContext bindingContext)
GenericModelBinderIntegrationTest.cs (1)
166public Task BindModelAsync(ModelBindingContext bindingContext)
SuccessfulModelBinder.cs (1)
13public Task BindModelAsync(ModelBindingContext bindingContext)
Microsoft.AspNetCore.OpenApi.Tests (1)
Services\OpenApiDocumentService\OpenApiDocumentServiceTests.Parameters.cs (1)
214public Task BindModelAsync(ModelBindingContext bindingContext)
RazorPagesWebSite (1)
PolymorphicModelBinder.cs (1)
11public Task BindModelAsync(ModelBindingContext bindingContext)