76 writes to BindingSource
ApplicationModelWebSite (1)
Controllers\ParameterModelController.cs (1)
26model.BindingInfo.BindingSource = BindingSource.Custom;
Microsoft.AspNetCore.Mvc.Abstractions (4)
ModelBinding\BindingInfo.cs (4)
33BindingSource = other.BindingSource; 143bindingInfo.BindingSource = bindingSourceAttribute.BindingSource; 188bindingInfo.BindingSource = BindingSource.Services; 248BindingSource = modelMetadata.BindingSource;
Microsoft.AspNetCore.Mvc.ApiExplorer.Test (2)
DefaultApiDescriptionProviderTest.cs (2)
259BindingSource = BindingSource.Path 288BindingSource = BindingSource.Path
Microsoft.AspNetCore.Mvc.Core (3)
ApplicationModels\InferParameterBindingInfoConvention.cs (1)
88parameter.BindingInfo.BindingSource = InferBindingSourceForParameter(parameter);
ModelBinding\Binders\HeaderModelBinderProvider.cs (1)
43BindingSource = BindingSource.ModelBinding
ModelBinding\ModelBindingHelper.cs (1)
258BindingSource = modelMetadata.BindingSource,
Microsoft.AspNetCore.Mvc.Core.Test (31)
ApplicationModels\ConsumesConstraintForFormFileParameterConventionTest.cs (1)
38BindingSource = BindingSource.FormFile,
ApplicationModels\ParameterModelTest.cs (1)
21BindingSource = BindingSource.Body
Controllers\ControllerBinderDelegateProviderTest.cs (8)
702BindingInfo = new BindingInfo() { BindingSource = BindingSource.Custom }, 743BindingInfo = new BindingInfo() { BindingSource = BindingSource.Custom }, 786BindingSource = BindingSource.Custom, 799BindingSource = BindingSource.Custom, 849BindingSource = BindingSource.Custom, 862BindingSource = BindingSource.Custom, 1095BindingSource = BindingSource.Body 1107BindingSource = BindingSource.Body
ModelBinding\Binders\BodyModelBinderProviderTest.cs (4)
32context.BindingInfo.BindingSource = source; 49context.BindingInfo.BindingSource = BindingSource.Body; 62context.BindingInfo.BindingSource = BindingSource.Body; 76context.BindingInfo.BindingSource = BindingSource.Body;
ModelBinding\Binders\ComplexObjectModelBinderTest.cs (1)
1100BindingSource = metadata.BindingSource,
ModelBinding\Binders\ComplexTypeModelBinderTest.cs (1)
1264BindingSource = metadata.BindingSource,
ModelBinding\Binders\HeaderModelBinderProviderTest.cs (7)
36context.BindingInfo.BindingSource = source; 59context.BindingInfo.BindingSource = BindingSource.Header; 82context.BindingInfo.BindingSource = BindingSource.Header; 108context.BindingInfo.BindingSource = BindingSource.Header; 130context.BindingInfo.BindingSource = BindingSource.Header; 152context.BindingInfo.BindingSource = BindingSource.Header; 169context.BindingInfo.BindingSource = BindingSource.Header;
ModelBinding\Binders\HeaderModelBinderTests.cs (1)
383BindingSource = metadata.BindingSource,
ModelBinding\Binders\ServicesModelBinderProviderTest.cs (2)
31context.BindingInfo.BindingSource = source; 47context.BindingInfo.BindingSource = BindingSource.Services;
ModelBinding\DefaultModelBindingContextTest.cs (2)
76new BindingInfo() { BindingSource = BindingSource.Query }, 128new BindingInfo() { BindingSource = BindingSource.Query },
ModelBinding\ModelBinderFactoryTest.cs (1)
296BindingSource = BindingSource.Services,
ModelBinding\TestModelBinderProviderContext.cs (2)
35BindingSource = Metadata.BindingSource, 50BindingSource = Metadata.BindingSource,
Microsoft.AspNetCore.Mvc.IntegrationTests (35)
BodyValidationIntegrationTests.cs (9)
29BindingSource = BindingSource.Body 71BindingSource = BindingSource.Body, 103BindingSource = BindingSource.Body 153BindingSource = BindingSource.Body 194BindingSource = BindingSource.Body 234BindingSource = BindingSource.Body 270BindingSource = BindingSource.Body 315BindingSource = BindingSource.Body 405BindingSource = BindingSource.Body
HeaderModelBinderIntegrationTest.cs (1)
270BindingSource = BindingSource.Header
ModelPrefixSelectionIntegrationTest.cs (3)
77BindingSource = BindingSource.Query, 165BindingSource = BindingSource.Query, 214BindingSource = BindingSource.Query,
ServicesModelBinderIntegrationTest.cs (9)
24BindingSource = BindingSource.Services 61BindingSource = BindingSource.Services, 97BindingSource = BindingSource.Services, 133BindingSource = BindingSource.Services, 169BindingSource = BindingSource.Services, 206BindingSource = BindingSource.Services, 239BindingSource = BindingSource.Services, 275BindingSource = BindingSource.Services, 308BindingSource = BindingSource.Services,
SimpleTypeModelBinderIntegrationTest.cs (1)
288BindingSource = BindingSource.Body,
ValidationIntegrationTests.cs (6)
57BindingSource = BindingSource.Body 69BindingSource = BindingSource.Body 1783BindingSource = BindingSource.Body 1873BindingSource = BindingSource.Body 1919BindingSource = BindingSource.Body 1974BindingSource = BindingSource.Body
ValidationWithRecordIntegrationTests.cs (6)
49BindingSource = BindingSource.Body 61BindingSource = BindingSource.Body 1586BindingSource = BindingSource.Body 1676BindingSource = BindingSource.Body 1722BindingSource = BindingSource.Body 1773BindingSource = BindingSource.Body
82 references to BindingSource
FormatterWebSite (1)
ValidateBodyParameterAttribute.cs (1)
20parameter.BindingInfo?.BindingSource));
Microsoft.AspNetCore.Mvc.Abstractions (5)
ModelBinding\BindingInfo.cs (5)
33BindingSource = other.BindingSource; 57/// Also set <see cref="BindingSource"/> if the specified <see cref="IModelBinder"/> implementation does not 182if (bindingInfo.BindingSource != null) 245if (BindingSource == null && modelMetadata.BindingSource != null) 261BindingSource == BindingSource.Body &&
Microsoft.AspNetCore.Mvc.Abstractions.Test (4)
ModelBinding\BindingInfoTest.cs (4)
27Assert.Same(BindingSource.Query, bindingInfo.BindingSource); 170Assert.Same(BindingSource.Custom, bindingInfo.BindingSource); 217Assert.Same(BindingSource.Services, bindingInfo.BindingSource); 309Assert.Same(BindingSource.Services, bindingInfo.BindingSource);
Microsoft.AspNetCore.Mvc.ApiExplorer (1)
DefaultApiDescriptionProvider.cs (1)
532BindingSource = bindingInfo?.BindingSource;
Microsoft.AspNetCore.Mvc.Core (12)
ApplicationModels\ConsumesConstraintForFormFileParameterConvention.cs (1)
50var bindingSource = parameter.BindingInfo?.BindingSource;
ApplicationModels\InferParameterBindingInfoConvention.cs (4)
14/// An <see cref="IActionModelConvention"/> that infers <see cref="BindingInfo.BindingSource"/> for parameters. 19/// <item>A previously specified <see cref="BindingInfo.BindingSource" /> is never overwritten.</item> 84var bindingSource = parameter.BindingInfo?.BindingSource; 92var fromBodyParameters = action.Parameters.Where(p => p.BindingInfo!.BindingSource == BindingSource.Body).ToList();
ModelBinding\Binders\BodyModelBinderProvider.cs (2)
72if (context.BindingInfo.BindingSource != null && 73context.BindingInfo.BindingSource.CanAcceptDataFrom(BindingSource.Body))
ModelBinding\Binders\HeaderModelBinderProvider.cs (2)
22if (bindingInfo.BindingSource == null || 23!bindingInfo.BindingSource.CanAcceptDataFrom(BindingSource.Header))
ModelBinding\Binders\ServicesModelBinderProvider.cs (2)
23if (context.BindingInfo.BindingSource != null && 24context.BindingInfo.BindingSource.CanAcceptDataFrom(BindingSource.Services))
ModelBinding\DefaultModelBindingContext.cs (1)
210var bindingSource = bindingInfo?.BindingSource ?? metadata.BindingSource;
Microsoft.AspNetCore.Mvc.Core.Test (53)
ApplicationModels\ApiBehaviorApplicationModelProviderTest.cs (2)
78Assert.Equal(BindingSource.Body, parameterModel.BindingInfo.BindingSource); 121Assert.Equal(BindingSource.Body, parameterModel.BindingInfo.BindingSource);
ApplicationModels\ControllerActionDescriptorBuilderTest.cs (1)
56Assert.Equal(BindingSource.Query, property.BindingInfo.BindingSource);
ApplicationModels\ControllerActionDescriptorProviderTests.cs (8)
130Assert.Null(id.BindingInfo?.BindingSource); 149Assert.Null(id.BindingInfo?.BindingSource); 155Assert.Equal(entity.BindingInfo.BindingSource, BindingSource.Body); 174Assert.Null(id.BindingInfo?.BindingSource); 180Assert.Null(upperCaseId.BindingInfo?.BindingSource); 186Assert.Null(id.BindingInfo?.BindingSource); 207Assert.Equal(entity.BindingInfo.BindingSource, BindingSource.Body); 228Assert.Null(entity.BindingInfo?.BindingSource);
ApplicationModels\DefaultApplicationModelProviderTest.cs (16)
81Assert.Equal(BindingSource.Query, property.BindingInfo.BindingSource); 90Assert.Equal(BindingSource.FormFile, property.BindingInfo.BindingSource); 98Assert.Equal(BindingSource.Services, property.BindingInfo.BindingSource); 133Assert.Equal(BindingSource.Query, property.BindingInfo.BindingSource); 142Assert.Equal(BindingSource.FormFile, property.BindingInfo.BindingSource); 150Assert.Equal(BindingSource.Services, property.BindingInfo.BindingSource); 159Assert.Equal(BindingSource.Special, property.BindingInfo.BindingSource); 186Assert.Equal(BindingSource.Query, parameter.BindingInfo.BindingSource); 195Assert.Equal(BindingSource.FormFile, parameter.BindingInfo.BindingSource); 230Assert.Equal(BindingSource.FormFile, parameter.BindingInfo.BindingSource); 235Assert.Equal(BindingSource.FormFile, parameter.BindingInfo.BindingSource); 240Assert.Equal(BindingSource.FormFile, parameter.BindingInfo.BindingSource); 245Assert.Equal(BindingSource.FormFile, parameter.BindingInfo.BindingSource); 250Assert.Equal(BindingSource.FormFile, parameter.BindingInfo.BindingSource); 278Assert.Equal(BindingSource.Special, parameter.BindingInfo.BindingSource); 306Assert.Equal(BindingSource.Query, parameter.BindingInfo.BindingSource);
ApplicationModels\InferParameterBindingInfoConventionTest.cs (24)
31Assert.Same(BindingSource.Custom, parameterModel.BindingInfo.BindingSource); 49Assert.Null(parameterModel.BindingInfo.BindingSource); 131Assert.Same(BindingSource.Body, bindingInfo.BindingSource); 139Assert.Equal(BindingSource.Special, bindingInfo.BindingSource); 165Assert.Same(BindingSource.Body, bindingInfo.BindingSource); 191Assert.Same(BindingSource.Body, bindingInfo.BindingSource); 217Assert.Same(BindingSource.Body, bindingInfo.BindingSource); 238Assert.Same(BindingSource.Query, bindingInfo.BindingSource); 259Assert.Same(BindingSource.Custom, bindingInfo.BindingSource); 280Assert.Same(BindingSource.Custom, bindingInfo.BindingSource); 528Assert.Same(BindingSource.Body, model.BindingInfo.BindingSource); 531Assert.Same(BindingSource.Special, cancellationToken.BindingInfo.BindingSource); 662Assert.Same(BindingSource.Query, bindingInfo.BindingSource); 683Assert.Same(BindingSource.Query, bindingInfo.BindingSource); 704Assert.Same(BindingSource.Query, bindingInfo.BindingSource); 724Assert.Same(BindingSource.Query, bindingInfo.BindingSource); 745Assert.Same(BindingSource.Query, bindingInfo.BindingSource); 766Assert.Same(BindingSource.Query, bindingInfo.BindingSource); 787Assert.Same(BindingSource.Query, bindingInfo.BindingSource); 808Assert.Same(BindingSource.Path, bindingInfo.BindingSource); 829Assert.Same(BindingSource.Path, bindingInfo.BindingSource); 850Assert.Same(BindingSource.Path, bindingInfo.BindingSource); 870Assert.Same(BindingSource.Path, bindingInfo.BindingSource); 893Assert.Same(BindingSource.Query, bindingInfo.BindingSource);
ModelBinding\ModelBinderFactoryTest.cs (2)
363Assert.Equal(expectedInfo.BindingSource, context.BindingInfo.BindingSource);
Microsoft.AspNetCore.Mvc.IntegrationTests (1)
GenericModelBinderIntegrationTest.cs (1)
152var allowedBindingSource = context.BindingInfo.BindingSource;
Microsoft.AspNetCore.Mvc.RazorPages.Test (5)
ApplicationModels\DefaultPageApplicationModelProviderTest.cs (5)
165Assert.Equal(BindingSource.Path, property.BindingInfo.BindingSource); 207Assert.Equal(BindingSource.Path, property.BindingInfo.BindingSource); 355Assert.Equal(BindingSource.Query, property.BindingInfo.BindingSource); 363Assert.Equal(BindingSource.Services, property.BindingInfo.BindingSource); 393Assert.Equal(BindingSource.Path, property.BindingInfo.BindingSource);