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