1 type derived from BindingSource
Microsoft.AspNetCore.Mvc.Abstractions (1)
ModelBinding\CompositeBindingSource.cs (1)
12public class CompositeBindingSource : BindingSource
24 instantiations of BindingSource
Microsoft.AspNetCore.Mvc.Abstractions (10)
ModelBinding\BindingSource.cs (10)
19public static readonly BindingSource Body = new BindingSource( 28public static readonly BindingSource Custom = new BindingSource( 37public static readonly BindingSource Form = new BindingSource( 46public static readonly BindingSource Header = new BindingSource( 56public static readonly BindingSource ModelBinding = new BindingSource( 65public static readonly BindingSource Path = new BindingSource( 74public static readonly BindingSource Query = new BindingSource( 83public static readonly BindingSource Services = new BindingSource( 92public static readonly BindingSource Special = new BindingSource( 101public static readonly BindingSource FormFile = new BindingSource(
Microsoft.AspNetCore.Mvc.ApiExplorer.Test (2)
DefaultApiDescriptionProviderTest.cs (2)
331var expected = new BindingSource(source, displayName: null, isGreedy: false, isFromRequest: false); 362var expected = new BindingSource(source, displayName: null, isGreedy: false, isFromRequest: false);
Microsoft.AspNetCore.Mvc.Core.Test (11)
ModelBinding\Binders\ComplexObjectModelBinderTest.cs (1)
1352get { return new BindingSource("Special", string.Empty, isGreedy: true, isFromRequest: true); }
ModelBinding\Binders\ComplexTypeModelBinderTest.cs (1)
1527get { return new BindingSource("Special", string.Empty, isGreedy: true, isFromRequest: true); }
ModelBinding\BindingSourceValueProviderTest.cs (1)
18var bindingSource = new BindingSource(
ModelBinding\CompositeValueProviderTest.cs (3)
21var bindingSource = new BindingSource( 264return new BindingSource("Test", displayName: null, isGreedy: true, isFromRequest: true); 279return new BindingSource("Unrelated", displayName: null, isGreedy: true, isFromRequest: true);
ModelBinding\EnumerableValueProviderTest.cs (2)
257var bindingSource = new BindingSource( 277var bindingSource = new BindingSource(
ModelBinding\RouteValueProviderTests.cs (2)
237var bindingSource = new BindingSource( 258var bindingSource = new BindingSource(
ModelBinding\TestValueProvider.cs (1)
10public static readonly BindingSource TestBindingSource = new BindingSource(
Microsoft.AspNetCore.Mvc.IntegrationTests (1)
GenericModelBinderIntegrationTest.cs (1)
133public static readonly BindingSource Source = new BindingSource(
699 references to BindingSource
ApplicationModelWebSite (1)
Controllers\ParameterModelController.cs (1)
26model.BindingInfo.BindingSource = BindingSource.Custom;
FormatterWebSite (2)
ValidateBodyParameterAttribute.cs (2)
44private bool IsBodyBindingSource(BindingSource bindingSource) 46return bindingSource?.CanAcceptDataFrom(BindingSource.Body) ?? false;
Microsoft.AspNetCore.Grpc.Swagger (4)
Internal\GrpcJsonTranscodingDescriptionProvider.cs (3)
119Source = BindingSource.Path, 141Source = BindingSource.Body, 161Source = BindingSource.Query,
Internal\GrpcModelMetadata.cs (1)
21public override BindingSource BindingSource { get; }
Microsoft.AspNetCore.Mvc.Abstractions (52)
ApiExplorer\ApiParameterDescription.cs (3)
30/// Gets or sets the <see cref="BindingSource"/>. 32public BindingSource Source { get; set; } = default!; 55/// <item><description>it's bound from the request body (<see cref="BindingSource.Body"/>).</description></item>
ApiExplorer\ApiParameterRouteInfo.cs (1)
34/// If the parameter uses <see cref="ModelBinding.BindingSource.ModelBinding"/> for the value of
ModelBinding\BindingInfo.cs (4)
43/// Gets or sets the <see cref="ModelBinding.BindingSource"/>. 45public BindingSource? BindingSource { get; set; } 188bindingInfo.BindingSource = BindingSource.Services; 261BindingSource == BindingSource.Body &&
ModelBinding\BindingSource.cs (32)
14public class BindingSource : IEquatable<BindingSource?> 17/// A <see cref="BindingSource"/> for the request body. 19public static readonly BindingSource Body = new BindingSource( 26/// A <see cref="BindingSource"/> for a custom model binder (unknown data source). 28public static readonly BindingSource Custom = new BindingSource( 35/// A <see cref="BindingSource"/> for the request form-data. 37public static readonly BindingSource Form = new BindingSource( 44/// A <see cref="BindingSource"/> for the request headers. 46public static readonly BindingSource Header = new BindingSource( 53/// A <see cref="BindingSource"/> for model binding. Includes form-data, query-string 56public static readonly BindingSource ModelBinding = new BindingSource( 63/// A <see cref="BindingSource"/> for the request url path. 65public static readonly BindingSource Path = new BindingSource( 72/// A <see cref="BindingSource"/> for the request query-string. 74public static readonly BindingSource Query = new BindingSource( 81/// A <see cref="BindingSource"/> for request services. 83public static readonly BindingSource Services = new BindingSource( 90/// A <see cref="BindingSource"/> for special parameter types that are not user input. 92public static readonly BindingSource Special = new BindingSource( 99/// A <see cref="BindingSource"/> for <see cref="IFormFile"/>, <see cref="IFormCollection"/>, and <see cref="IFormFileCollection"/>. 101public static readonly BindingSource FormFile = new BindingSource( 108/// Creates a new <see cref="BindingSource"/>. 161/// Some sources (like <see cref="BindingSource.Services"/>) are based on application state and not user 167/// Gets a value indicating whether or not the <see cref="BindingSource"/> can accept 170/// <param name="bindingSource">The <see cref="BindingSource"/> to consider as input.</param> 180public virtual bool CanAcceptDataFrom(BindingSource bindingSource) 206public bool Equals(BindingSource? other) 214return Equals(obj as BindingSource); 224public static bool operator ==(BindingSource? s1, BindingSource? s2) 235public static bool operator !=(BindingSource? s1, BindingSource? s2)
ModelBinding\CompositeBindingSource.cs (8)
18/// The set of <see cref="BindingSource"/> entries. 24IEnumerable<BindingSource> bindingSources, 29foreach (var bindingSource in bindingSources) 63IEnumerable<BindingSource> bindingSources) 73/// Gets the set of <see cref="BindingSource"/> entries. 75public IEnumerable<BindingSource> BindingSources { get; } 78public override bool CanAcceptDataFrom(BindingSource bindingSource) 90foreach (var source in BindingSources)
ModelBinding\IBindingSourceMetadata.cs (1)
18BindingSource? BindingSource { get; }
ModelBinding\ModelBindingContext.cs (2)
28/// Gets or sets a value which represents the <see cref="ModelBinding.BindingSource"/> associated with the 31public abstract BindingSource? BindingSource { get; set; }
ModelBinding\ModelMetadata.cs (1)
214public abstract BindingSource? BindingSource { get; }
Microsoft.AspNetCore.Mvc.Abstractions.Test (8)
ModelBinding\BindingInfoTest.cs (7)
27Assert.Same(BindingSource.Query, bindingInfo.BindingSource); 108metadata.BindingSource = BindingSource.Special; 157metadata.BindingSource = BindingSource.Special; 170Assert.Same(BindingSource.Custom, bindingInfo.BindingSource); 208metadata.BindingSource = BindingSource.Services; 217Assert.Same(BindingSource.Services, bindingInfo.BindingSource); 309Assert.Same(BindingSource.Services, bindingInfo.BindingSource);
ModelBinding\ModelMetadataTest.cs (1)
487public override BindingSource BindingSource
Microsoft.AspNetCore.Mvc.ApiExplorer (37)
DefaultApiDescriptionProvider.cs (20)
135if (parameter.Source == BindingSource.Body) 145else if (parameter.Source == BindingSource.FormFile) 250if (parameter.Source == BindingSource.Path || 251parameter.Source == BindingSource.ModelBinding || 252parameter.Source == BindingSource.Custom) 259if (parameter.Source == BindingSource.ModelBinding && 264parameter.Source = BindingSource.Path; 269if (parameter.Source == BindingSource.Path && 292Source = BindingSource.Path, 301if (parameter.Source == BindingSource.Body) 318if (parameter.Source == BindingSource.Path && parameter.RouteInfo != null && !parameter.RouteInfo.IsOptional) 329if (parameter.Source == BindingSource.Path) 518public BindingSource? BindingSource { get; } 562var source = BindingSource.ModelBinding; 568BindingSource ambientSource, 571var source = bindingContext.BindingSource; 655BindingSource source, 692public readonly BindingSource? Source; 694public PropertyKey(ModelMetadata metadata, BindingSource? source)
EndpointMetadataApiDescriptionProvider.cs (16)
127parameterDescription.Source == BindingSource.Body || 128parameterDescription.Source == BindingSource.FormFile; 147Source = BindingSource.Body, 177if (source == BindingSource.Services) 250private (BindingSource, string, bool, Type) GetBindingSourceAndName(IParameterBindingMetadata parameter, RouteEndpoint routeEndpoint, bool disableInferredBody) 259return (BindingSource.Path, routeAttribute.Name ?? name, false, parameterType); 263return (BindingSource.Query, queryAttribute.Name ?? parameter.Name ?? string.Empty, false, parameterType); 267return (BindingSource.Header, headerAttribute.Name ?? parameter.Name ?? string.Empty, false, parameterType); 271return (BindingSource.Body, parameter.Name ?? string.Empty, fromBodyAttribute.AllowEmpty, parameterType); 275return (BindingSource.FormFile, fromFormAttribute.Name ?? parameter.Name ?? string.Empty, false, parameterType); 286return (BindingSource.Services, parameter.Name ?? string.Empty, false, parameterType); 296return (BindingSource.Path, routeParam.Name, false, displayType); 300return (BindingSource.Query, parameter.Name ?? string.Empty, false, displayType); 305return (BindingSource.FormFile, parameter.Name ?? string.Empty, false, parameterType); 312return (BindingSource.Query, parameter.Name ?? string.Empty, false, parameterType); 316return (BindingSource.Body, parameter.Name ?? string.Empty, false, parameterType);
EndpointModelMetadata.cs (1)
21public override BindingSource? BindingSource { get; }
Microsoft.AspNetCore.Mvc.ApiExplorer.Test (101)
DefaultApiDescriptionProviderTest.cs (76)
185Assert.Equal(BindingSource.Path, parameter.Source); 231Assert.Equal(BindingSource.Path, parameter.Source); 259BindingSource = BindingSource.Path 288BindingSource = BindingSource.Path 297Assert.Equal(BindingSource.Path, parameter.Source); 331var expected = new BindingSource(source, displayName: null, isGreedy: false, isFromRequest: false); 362var expected = new BindingSource(source, displayName: null, isGreedy: false, isFromRequest: false); 438Assert.Equal(BindingSource.Path, id1.Source); 442Assert.Equal(BindingSource.Path, id2.Source); 1327Assert.Same(BindingSource.ModelBinding, parameter.Source); 1331Assert.Same(BindingSource.ModelBinding, parameter.Source); 1335Assert.Same(BindingSource.ModelBinding, parameter.Source); 1352Assert.Same(BindingSource.ModelBinding, parameter.Source); 1372Assert.Same(BindingSource.Path, parameter.Source); 1389Assert.Same(BindingSource.Query, parameter.Source); 1406Assert.Same(BindingSource.Body, parameter.Source); 1425Assert.Same(BindingSource.Form, parameter.Source); 1429Assert.Same(BindingSource.Form, parameter.Source); 1433Assert.Same(BindingSource.Form, parameter.Source); 1455Assert.Same(BindingSource.FormFile, parameter.Source); 1476Assert.Same(BindingSource.Header, parameter.Source); 1508Assert.Same(BindingSource.Custom, parameter.Source); 1527Assert.Same(BindingSource.ModelBinding, parameter.Source); 1531Assert.Same(BindingSource.ModelBinding, parameter.Source); 1535Assert.Same(BindingSource.ModelBinding, parameter.Source); 1554Assert.Same(BindingSource.Path, id.Source); 1558Assert.Same(BindingSource.Body, product.Source); 1562Assert.Same(BindingSource.Header, userId.Source); 1566Assert.Same(BindingSource.ModelBinding, comments.Source); 1585Assert.Same(BindingSource.Query, id.Source); 1604Assert.Same(BindingSource.Query, id.Source); 1623Assert.Same(BindingSource.Query, id.Source); 1642Assert.Same(BindingSource.Query, id.Source); 1661Assert.Same(BindingSource.Query, id.Source); 1680Assert.Same(BindingSource.Query, id.Source); 1699Assert.Same(BindingSource.Query, id.Source); 1718Assert.Same(BindingSource.Query, id.Source); 1722Assert.Same(BindingSource.Query, product.Source); 1742Assert.Same(BindingSource.Path, id.Source); 1746Assert.Same(BindingSource.Body, product.Source); 1750Assert.Same(BindingSource.Header, userId.Source); 1754Assert.Same(BindingSource.Query, comments.Source); 1773Assert.Same(BindingSource.Path, id.Source); 1777Assert.Same(BindingSource.ModelBinding, quantity.Source); 1781Assert.Same(BindingSource.ModelBinding, productId.Source); 1785Assert.Same(BindingSource.Query, price.Source); 1805Assert.Same(BindingSource.Path, id.Source); 1809Assert.Same(BindingSource.Query, quantity.Source); 1813Assert.Same(BindingSource.Query, productId.Source); 1817Assert.Same(BindingSource.Query, productPrice.Source); 1840Assert.Same(BindingSource.Query, id.Source); 1844Assert.Same(BindingSource.Query, name.Source); 1871Assert.Same(BindingSource.Query, id.Source); 1875Assert.Same(BindingSource.Query, name.Source); 1894Assert.Same(BindingSource.Query, c.Source); 1912Assert.Same(BindingSource.Query, products.Source); 1931Assert.Same(BindingSource.ModelBinding, items.Source); 1953Assert.Same(BindingSource.Query, id.Source); 1957Assert.Same(BindingSource.Query, name.Source); 1975Assert.Same(BindingSource.Header, name.Source); 1979Assert.Same(BindingSource.Form, id.Source); 1998Assert.Same(BindingSource.Query, name.Source); 2002Assert.Same(BindingSource.Path, id.Source); 2006Assert.Same(BindingSource.Body, product.Source); 2010Assert.Same(BindingSource.Header, userId.Source); 2014Assert.Same(BindingSource.ModelBinding, comments.Source); 2022var description = new ApiParameterDescription { Source = BindingSource.Body, }; 2036var description = new ApiParameterDescription { Source = BindingSource.Body, }; 2052Source = BindingSource.Body, 2073Source = BindingSource.Query, 2095Source = BindingSource.Path, 2150Source = BindingSource.Path, 2174Source = BindingSource.Query, 2197Source = BindingSource.Query, 2897public BindingSource BindingSource => BindingSource.FormFile;
EndpointMetadataApiDescriptionProviderTest.cs (25)
424Assert.Equal(BindingSource.Path, param.Source); 439Assert.Equal(BindingSource.Path, param.Source); 453Assert.Equal(BindingSource.Path, param.Source); 467Assert.Equal(BindingSource.Path, param.Source); 488Assert.Equal(BindingSource.Path, param.Source); 509Assert.Equal(BindingSource.Path, param.Source); 523Assert.Equal(BindingSource.Path, param.Source); 537Assert.Equal(BindingSource.Query, param.Source); 559Assert.Equal(BindingSource.Body, param.Source); 575Assert.Equal(BindingSource.Header, param.Source); 601Assert.Equal(BindingSource.Body, param.Source); 627Assert.Equal(BindingSource.Path, fooParam.Source); 634Assert.Equal(BindingSource.Query, barParam.Source); 641Assert.Equal(BindingSource.Body, fromBodyParam.Source); 657Assert.Equal(BindingSource.Path, param.Source); 664Assert.Equal(BindingSource.Query, param.Source); 672Assert.Equal(BindingSource.Body, param.Source); 748Assert.Equal(BindingSource.Path, fooParam.Source); 754Assert.Equal(BindingSource.Query, barParam.Source); 793Assert.Equal(BindingSource.Query, fooParam.Source); 799Assert.Equal(BindingSource.Query, barParam.Source); 812Assert.Equal(BindingSource.Query, nameParam.Source); 1297Assert.Equal(BindingSource.FormFile, fromFileParam0.Source); 1303Assert.Equal(BindingSource.FormFile, fromFileParam1.Source); 1315Assert.Equal(BindingSource.FormFile, param.Source);
Microsoft.AspNetCore.Mvc.Core (102)
ApiBehaviorOptions.cs (3)
41/// Parameters that appear as route values, are assumed to be bound from the path (<see cref="BindingSource.Path"/>). 43/// Parameters that are complex (<see cref="ModelMetadata.IsComplexType"/>) and are registered in the DI Container (<see cref="IServiceCollection"/>) are assumed to be bound from the services <see cref="BindingSource.Services"/>, unless this 45/// Parameters that are complex (<see cref="ModelMetadata.IsComplexType"/>) are assumed to be bound from the body (<see cref="BindingSource.Body"/>).
ApplicationModels\ConsumesConstraintForFormFileParameterConvention.cs (3)
12/// to controllers containing form file (<see cref="BindingSource.FormFile"/>) parameters. 50var bindingSource = parameter.BindingInfo?.BindingSource; 51if (bindingSource == BindingSource.FormFile)
ApplicationModels\InferParameterBindingInfoConvention.cs (12)
17/// The goal of this convention is to make intuitive and easy to document <see cref="BindingSource"/> inferences. The rules are: 20/// <item>A complex type parameter (<see cref="ModelMetadata.IsComplexType"/>), registered in the DI container, is assigned <see cref="BindingSource.Services"/>.</item> 21/// <item>A complex type parameter (<see cref="ModelMetadata.IsComplexType"/>), not registered in the DI container, is assigned <see cref="BindingSource.Body"/>.</item> 22/// <item>Parameter with a name that appears as a route value in ANY route template is assigned <see cref="BindingSource.Path"/>.</item> 23/// <item>All other parameters are <see cref="BindingSource.Query"/>.</item> 84var bindingSource = parameter.BindingInfo?.BindingSource; 92var fromBodyParameters = action.Parameters.Where(p => p.BindingInfo!.BindingSource == BindingSource.Body).ToList(); 114internal BindingSource? InferBindingSourceForParameter(ParameterModel parameter) 120return BindingSource.Services; 123return metadata.BoundProperties.Any(prop => prop.BindingSource is not null) ? null : BindingSource.Body; 128return BindingSource.Path; 131return BindingSource.Query;
BindPropertyAttribute.cs (5)
25private BindingSource? _bindingSource; 38/// Subclass this attribute and set <see cref="BindingSource"/> if <see cref="BindingSource.Custom"/> is not 62/// defaults to <see cref="BindingSource.Custom"/>. May be overridden in a subclass. 64public virtual BindingSource? BindingSource 70return BindingSource.Custom;
FromBodyAttribute.cs (2)
44public BindingSource BindingSource => BindingSource.Body;
FromFormAttribute.cs (2)
32public BindingSource BindingSource => BindingSource.Form;
FromHeaderAttribute.cs (2)
31public BindingSource BindingSource => BindingSource.Header;
FromQueryAttribute.cs (2)
31public BindingSource BindingSource => BindingSource.Query;
FromRouteAttribute.cs (2)
31public BindingSource BindingSource => BindingSource.Path;
FromServicesAttribute.cs (2)
29public BindingSource BindingSource => BindingSource.Services;
Infrastructure\MvcCoreMvcOptionsSetup.cs (5)
116modelMetadataDetailsProviders.Add(new BindingSourceMetadataProvider(typeof(CancellationToken), BindingSource.Special)); 117modelMetadataDetailsProviders.Add(new BindingSourceMetadataProvider(typeof(IFormFile), BindingSource.FormFile)); 118modelMetadataDetailsProviders.Add(new BindingSourceMetadataProvider(typeof(IFormCollection), BindingSource.FormFile)); 119modelMetadataDetailsProviders.Add(new BindingSourceMetadataProvider(typeof(IFormFileCollection), BindingSource.FormFile)); 120modelMetadataDetailsProviders.Add(new BindingSourceMetadataProvider(typeof(IEnumerable<IFormFile>), BindingSource.FormFile));
ModelBinderAttribute.cs (6)
29private BindingSource? _bindingSource; 44/// Subclass this attribute and set <see cref="BindingSource"/> if <see cref="BindingSource.Custom"/> is not 56/// Subclass this attribute and set <see cref="BindingSource"/> if <see cref="BindingSource.Custom"/> is not 80/// defaults to <see cref="BindingSource.Custom"/>. May be overridden in a subclass. 82public virtual BindingSource? BindingSource 88return BindingSource.Custom;
ModelBinderOfTAttribute.cs (2)
20/// Subclass this attribute and set <see cref="BindingSource"/> if <see cref="BindingSource.Custom"/> is not
ModelBinding\Binders\BodyModelBinder.cs (1)
18/// when a model has the binding source <see cref="BindingSource.Body"/>.
ModelBinding\Binders\BodyModelBinderProvider.cs (1)
73context.BindingInfo.BindingSource.CanAcceptDataFrom(BindingSource.Body))
ModelBinding\Binders\ComplexObjectModelBinder.cs (3)
523var bindingSource = bindingContext.BindingSource; 587var bindingSource = propertyMetadata.BindingSource; 623var bindingSource = parameterMetadata.BindingSource;
ModelBinding\Binders\ComplexTypeModelBinder.cs (2)
328var bindingSource = bindingContext.BindingSource; 388var bindingSource = propertyMetadata.BindingSource;
ModelBinding\Binders\HeaderModelBinder.cs (1)
15/// has the binding source <see cref="BindingSource.Header"/>.
ModelBinding\Binders\HeaderModelBinderProvider.cs (2)
23!bindingInfo.BindingSource.CanAcceptDataFrom(BindingSource.Header)) 43BindingSource = BindingSource.ModelBinding
ModelBinding\Binders\ServicesModelBinder.cs (1)
13/// has the binding source <see cref="BindingSource.Services"/>.
ModelBinding\Binders\ServicesModelBinderProvider.cs (1)
24context.BindingInfo.BindingSource.CanAcceptDataFrom(BindingSource.Services))
ModelBinding\BindingSourceValueProvider.cs (9)
17/// <see cref="ModelBinding.BindingSource"/>. 22/// <see cref="ModelBinding.BindingSource"/>. Value providers are by-default included; if a model does not 23/// specify a <see cref="ModelBinding.BindingSource"/> then all value providers are valid. 32/// The <see cref="ModelBinding.BindingSource"/>. Must be a single-source (non-composite) with 33/// <see cref="ModelBinding.BindingSource.IsGreedy"/> equal to <c>false</c>. 35public BindingSourceValueProvider(BindingSource bindingSource) 59/// Gets the corresponding <see cref="ModelBinding.BindingSource"/>. 61protected BindingSource BindingSource { get; } 70public virtual IValueProvider? Filter(BindingSource bindingSource)
ModelBinding\CompositeValueProvider.cs (1)
161public IValueProvider? Filter(BindingSource bindingSource)
ModelBinding\DefaultModelBindingContext.cs (4)
99public override BindingSource? BindingSource 210var bindingSource = bindingInfo?.BindingSource ?? metadata.BindingSource; 308private static IValueProvider FilterValueProvider(IValueProvider valueProvider, BindingSource? bindingSource) 334public BindingSource? BindingSource;
ModelBinding\FormValueProvider.cs (2)
23/// <param name="bindingSource">The <see cref="BindingSource"/> for the data.</param> 27BindingSource bindingSource,
ModelBinding\FormValueProviderFactory.cs (1)
55BindingSource.Form,
ModelBinding\IBindingSourceValueProvider.cs (4)
9/// A value provider which can filter its contents based on <see cref="BindingSource"/>. 12/// Value providers are by-default included. If a model does not specify a <see cref="BindingSource"/> 20/// <param name="bindingSource">The <see cref="BindingSource"/> associated with a model.</param> 25IValueProvider? Filter(BindingSource bindingSource);
ModelBinding\JQueryFormValueProvider.cs (2)
21/// <param name="bindingSource">The <see cref="BindingSource"/> of the data.</param> 25BindingSource bindingSource,
ModelBinding\JQueryFormValueProviderFactory.cs (1)
55BindingSource.Form,
ModelBinding\JQueryQueryStringValueProvider.cs (2)
19/// <param name="bindingSource">The <see cref="BindingSource"/> of the data.</param> 23BindingSource bindingSource,
ModelBinding\JQueryQueryStringValueProviderFactory.cs (1)
24BindingSource.Query,
ModelBinding\JQueryValueProvider.cs (2)
25/// <param name="bindingSource">The <see cref="BindingSource"/> of the data.</param> 29BindingSource bindingSource,
ModelBinding\Metadata\BindingMetadata.cs (2)
21/// Gets or sets the <see cref="ModelBinding.BindingSource"/>. 24public BindingSource? BindingSource { get; set; }
ModelBinding\Metadata\BindingSourceMetadataProvider.cs (2)
23public BindingSourceMetadataProvider(Type type, BindingSource? bindingSource) 40public BindingSource? BindingSource { get; }
ModelBinding\Metadata\DefaultModelMetadata.cs (1)
167public override BindingSource? BindingSource => BindingMetadata.BindingSource;
ModelBinding\QueryStringValueProvider.cs (2)
22/// <param name="bindingSource">The <see cref="BindingSource"/> for the data.</param> 26BindingSource bindingSource,
ModelBinding\QueryStringValueProviderFactory.cs (1)
25BindingSource.Query,
ModelBinding\RouteValueProvider.cs (4)
22/// <param name="bindingSource">The <see cref="BindingSource"/> of the data.</param> 26BindingSource bindingSource, 35/// <param name="bindingSource">The <see cref="BindingSource"/> of the data.</param> 38public RouteValueProvider(BindingSource bindingSource, RouteValueDictionary values, CultureInfo culture)
ModelBinding\RouteValueProviderFactory.cs (1)
19BindingSource.Path,
Microsoft.AspNetCore.Mvc.Core.Test (310)
ApplicationModels\ApiBehaviorApplicationModelProviderTest.cs (2)
78Assert.Equal(BindingSource.Body, parameterModel.BindingInfo.BindingSource); 121Assert.Equal(BindingSource.Body, parameterModel.BindingInfo.BindingSource);
ApplicationModels\ConsumesConstraintForFormFileParameterConventionTest.cs (1)
38BindingSource = BindingSource.FormFile,
ApplicationModels\ControllerActionDescriptorBuilderTest.cs (1)
56Assert.Equal(BindingSource.Query, property.BindingInfo.BindingSource);
ApplicationModels\ControllerActionDescriptorProviderTests.cs (2)
155Assert.Equal(entity.BindingInfo.BindingSource, BindingSource.Body); 207Assert.Equal(entity.BindingInfo.BindingSource, BindingSource.Body);
ApplicationModels\DefaultApplicationModelProviderTest.cs (20)
81Assert.Equal(BindingSource.Query, property.BindingInfo.BindingSource); 90Assert.Equal(BindingSource.FormFile, property.BindingInfo.BindingSource); 98Assert.Equal(BindingSource.Services, property.BindingInfo.BindingSource); 116var detailsProvider = new BindingSourceMetadataProvider(typeof(string), BindingSource.Special); 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); 259var detailsProvider = new BindingSourceMetadataProvider(typeof(Guid), BindingSource.Special); 278Assert.Equal(BindingSource.Special, parameter.BindingInfo.BindingSource); 287var detailsProvider = new BindingSourceMetadataProvider(typeof(Guid), BindingSource.Special); 306Assert.Equal(BindingSource.Query, parameter.BindingInfo.BindingSource); 1338Assert.Same(BindingSource.Path, property.BindingInfo.BindingSource);
ApplicationModels\InferParameterBindingInfoConventionTest.cs (67)
31Assert.Same(BindingSource.Custom, 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); 293var result = convention.InferBindingSourceForParameter(parameter); 296Assert.Same(BindingSource.Path, result); 308var result = convention.InferBindingSourceForParameter(parameter); 311Assert.Same(BindingSource.Path, result); 323var result = convention.InferBindingSourceForParameter(parameter); 326Assert.Same(BindingSource.Path, result); 338var result = convention.InferBindingSourceForParameter(parameter); 341Assert.Same(BindingSource.Body, result); 353var result = convention.InferBindingSourceForParameter(parameter); 356Assert.Same(BindingSource.Path, result); 368var result = convention.InferBindingSourceForParameter(parameter); 371Assert.Same(BindingSource.Path, result); 383var result = convention.InferBindingSourceForParameter(parameter); 386Assert.Same(BindingSource.Path, result); 398var result = convention.InferBindingSourceForParameter(parameter); 401Assert.Same(BindingSource.Path, result); 413var result = convention.InferBindingSourceForParameter(parameter); 416Assert.Same(BindingSource.Path, result); 428var result = convention.InferBindingSourceForParameter(parameter); 431Assert.Same(BindingSource.Query, result); 443var result = convention.InferBindingSourceForParameter(parameter); 446Assert.Same(BindingSource.Path, result); 458var result = convention.InferBindingSourceForParameter(parameter); 461Assert.Same(BindingSource.Path, result); 473var result = convention.InferBindingSourceForParameter(parameter); 476Assert.Same(BindingSource.Path, result); 488var result = convention.InferBindingSourceForParameter(parameter); 491Assert.Same(BindingSource.Query, result); 503var result = convention.InferBindingSourceForParameter(parameter); 506Assert.Same(BindingSource.Body, result); 528Assert.Same(BindingSource.Body, model.BindingInfo.BindingSource); 531Assert.Same(BindingSource.Special, cancellationToken.BindingInfo.BindingSource); 543var result = convention.InferBindingSourceForParameter(parameter); 546Assert.Same(BindingSource.Query, result); 558var result = convention.InferBindingSourceForParameter(parameter); 561Assert.Same(BindingSource.Body, result); 573var result = convention.InferBindingSourceForParameter(parameter); 576Assert.Same(BindingSource.Body, result); 588var result = convention.InferBindingSourceForParameter(parameter); 591Assert.Same(BindingSource.Body, result); 603var result = convention.InferBindingSourceForParameter(parameter); 606Assert.Same(BindingSource.Body, result); 620var result = convention.InferBindingSourceForParameter(parameter); 624Assert.Same(BindingSource.Services, result); 638var result = convention.InferBindingSourceForParameter(parameter); 642Assert.Same(BindingSource.Services, result); 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);
ApplicationModels\ParameterModelTest.cs (1)
21BindingSource = BindingSource.Body
Controllers\ControllerBinderDelegateProviderTest.cs (12)
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 1405public BindingSource BindingSource { get { return BindingSource.Custom; } } 1410public BindingSource BindingSource { get { return BindingSource.Query; } }
ModelBinding\Binders\BodyModelBinderProviderTest.cs (8)
11public static TheoryData<BindingSource> NonBodyBindingSources 15return new TheoryData<BindingSource>() 17BindingSource.Header, 18BindingSource.Form, 26public void GetBinder_WhenBindingSourceIsNotFromBody_ReturnsNull(BindingSource source) 49context.BindingInfo.BindingSource = BindingSource.Body; 62context.BindingInfo.BindingSource = BindingSource.Body; 76context.BindingInfo.BindingSource = BindingSource.Body;
ModelBinding\Binders\BodyModelBinderTests.cs (22)
34provider.ForType<Person>().BindingDetails(d => d.BindingSource = BindingSource.Body); 56provider.ForType<Person>().BindingDetails(d => d.BindingSource = BindingSource.Body); 80provider.ForType<Person>().BindingDetails(d => d.BindingSource = BindingSource.Body); 105provider.ForType<Person>().BindingDetails(d => d.BindingSource = BindingSource.Body); 132d.BindingSource = BindingSource.Body; 173provider.ForType<Person>().BindingDetails(d => d.BindingSource = BindingSource.Body); 201provider.ForType<Person>().BindingDetails(d => d.BindingSource = BindingSource.Body); 229provider.ForType<Person>().BindingDetails(d => d.BindingSource = BindingSource.Body); 257metadataProvider.ForType<Person>().BindingDetails(d => d.BindingSource = BindingSource.Body); 305metadataProvider.ForType<Person>().BindingDetails(d => d.BindingSource = BindingSource.Body); 334metadataProvider.ForType<Person>().BindingDetails(d => d.BindingSource = BindingSource.Body); 376metadataProvider.ForType<Person>().BindingDetails(d => d.BindingSource = BindingSource.Body); 405metadataProvider.ForType<Person>().BindingDetails(d => d.BindingSource = BindingSource.Body); 452metadataProvider.ForType<Person>().BindingDetails(d => d.BindingSource = BindingSource.Body); 487metadataProvider.ForType<Person>().BindingDetails(d => d.BindingSource = BindingSource.Body); 516metadataProvider.ForType<Person>().BindingDetails(d => d.BindingSource = BindingSource.Body); 539provider.ForType<Person>().BindingDetails(d => d.BindingSource = BindingSource.Body); 577provider.ForType<Person>().BindingDetails(d => d.BindingSource = BindingSource.Body); 602provider.ForType<Person>().BindingDetails(d => d.BindingSource = BindingSource.Body); 631provider.ForType<Person>().BindingDetails(d => d.BindingSource = BindingSource.Body); 663provider.ForType<Person>().BindingDetails(d => d.BindingSource = BindingSource.Body); 701BindingSource = BindingSource.Body,
ModelBinding\Binders\ComplexObjectModelBinderTest.cs (6)
221.Setup(o => o.Filter(It.IsAny<BindingSource>())) 222.Returns<BindingSource>(source => source == BindingSource.Query ? originalValueProvider.Object : null); 1350public BindingSource BindingSource 1358public BindingSource BindingSource { get { return BindingSource.Query; } }
ModelBinding\Binders\ComplexTypeModelBinderTest.cs (6)
220.Setup(o => o.Filter(It.IsAny<BindingSource>())) 221.Returns<BindingSource>(source => source == BindingSource.Query ? originalValueProvider.Object : null); 1525public BindingSource BindingSource 1533public BindingSource BindingSource { get { return BindingSource.Query; } }
ModelBinding\Binders\DictionaryModelBinderTest.cs (2)
648BindingSource.Form, 661return new TestValueProvider(BindingSource.Form, backingStore);
ModelBinding\Binders\FormFileModelBinderTest.cs (1)
437.BindingDetails(bd => bd.BindingSource = BindingSource.Header);
ModelBinding\Binders\HeaderModelBinderProviderTest.cs (11)
14public static TheoryData<BindingSource> NonHeaderBindingSources 18return new TheoryData<BindingSource>() 20BindingSource.Body, 21BindingSource.Form, 29public void Create_WhenBindingSourceIsNotFromHeader_ReturnsNull(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 (2)
392metadataProvider.ForType(modelType).BindingDetails(d => d.BindingSource = BindingSource.Header); 401.BindingDetails(bd => bd.BindingSource = BindingSource.Header);
ModelBinding\Binders\ServicesModelBinderProviderTest.cs (6)
10public static TheoryData<BindingSource> NonServicesBindingSources 14return new TheoryData<BindingSource>() 16BindingSource.Header, 17BindingSource.Form, 25public void Create_WhenBindingSourceIsNotFromServices_ReturnsNull(BindingSource source) 47context.BindingInfo.BindingSource = BindingSource.Services;
ModelBinding\Binders\ServicesModelBinderTest.cs (1)
36metadataProvider.ForType(modelType).BindingDetails(d => d.BindingSource = BindingSource.Services);
ModelBinding\BindingSourceValueProviderTest.cs (9)
18var bindingSource = new BindingSource( 39bindingSources: new BindingSource[] { BindingSource.Query, BindingSource.Form }, 53var valueProvider = new TestableBindingSourceValueProvider(BindingSource.Query); 56var result = valueProvider.Filter(BindingSource.Body); 66var valueProvider = new TestableBindingSourceValueProvider(BindingSource.Query); 69var result = valueProvider.Filter(BindingSource.Query); 77public TestableBindingSourceValueProvider(BindingSource source)
ModelBinding\CompositeValueProviderTest.cs (8)
19var provider = GetBindingSourceValueProvider(BindingSource.Query, BackingStore, culture: null); 21var bindingSource = new BindingSource( 22BindingSource.Query.Id, 36BindingSource bindingSource, 248.Setup(o => o.Filter(It.Is<BindingSource>(s => s.Id == bindingSourceId))) 252.Setup(o => o.Filter(It.Is<BindingSource>(s => s.Id != bindingSourceId))) 260public BindingSource BindingSource 275public BindingSource BindingSource
ModelBinding\DefaultModelBindingContextTest.cs (9)
32d.BindingSource = BindingSource.Custom; 41var originalBindingSource = bindingContext.BindingSource; 76new BindingInfo() { BindingSource = BindingSource.Query }, 92.BindingDetails(b => b.BindingSource = BindingSource.Query); 120.BindingDetails(b => b.BindingSource = BindingSource.Form); 128new BindingInfo() { BindingSource = BindingSource.Query }, 172result.Add(new RouteValueProvider(BindingSource.Path, new RouteValueDictionary())); 174BindingSource.Query, 178BindingSource.Form,
ModelBinding\EnumerableValueProviderTest.cs (21)
33var valueProvider = GetEnumerableValueProvider(BindingSource.Query, backingStore, culture: null); 46var valueProvider = GetEnumerableValueProvider(BindingSource.Query, BackingStore, culture: null); 64var valueProvider = GetEnumerableValueProvider(BindingSource.Query, BackingStore, culture: null); 74var valueProvider = GetEnumerableValueProvider(BindingSource.Query, BackingStore, culture: null); 94var valueProvider = GetEnumerableValueProvider(BindingSource.Query, BackingStore, culture: null); 107var valueProvider = GetEnumerableValueProvider(BindingSource.Query, BackingStore, culture: null); 129var valueProvider = GetEnumerableValueProvider(BindingSource.Query, BackingStore, culture: null); 147var valueProvider = GetEnumerableValueProvider(BindingSource.Query, BackingStore, culture: null); 161var valueProvider = GetEnumerableValueProvider(BindingSource.Query, BackingStore, culture); 176var valueProvider = GetEnumerableValueProvider(BindingSource.Query, BackingStore, culture); 194var valueProvider = GetEnumerableValueProvider(BindingSource.Query, BackingStore, culture); 212var valueProvider = GetEnumerableValueProvider(BindingSource.Query, backingStore, culture); 225var valueProvider = GetEnumerableValueProvider(BindingSource.Query, BackingStore, culture: null); 242var valueProvider = GetEnumerableValueProvider(BindingSource.Query, store, culture: null); 255var provider = GetBindingSourceValueProvider(BindingSource.Query, BackingStore, culture: null); 257var bindingSource = new BindingSource( 258BindingSource.Query.Id, 275var provider = GetBindingSourceValueProvider(BindingSource.Query, BackingStore, culture: null); 277var bindingSource = new BindingSource( 291BindingSource bindingSource, 304BindingSource bindingSource,
ModelBinding\FormValueProviderTest.cs (2)
23var valueProvider = GetEnumerableValueProvider(BindingSource.Query, values, culture); 38BindingSource bindingSource,
ModelBinding\JQueryFormValueProviderTest.cs (4)
12BindingSource bindingSource, 24var provider = new JQueryFormValueProvider(BindingSource.Form, dictionary, CultureInfo.CurrentCulture); 41var valueProvider = GetEnumerableValueProvider(BindingSource.Query, store, culture: null); 61var valueProvider = GetEnumerableValueProvider(BindingSource.Query, values, culture);
ModelBinding\JQueryQueryStringValueProviderTest.cs (3)
12BindingSource bindingSource, 25BindingSource.Form, 44var valueProvider = GetEnumerableValueProvider(BindingSource.Query, store, culture: null);
ModelBinding\Metadata\BindingSourceMetadataProviderTests.cs (2)
12var provider = new BindingSourceMetadataProvider(typeof(Test), BindingSource.Special); 22Assert.Equal(BindingSource.Special, context.BindingMetadata.BindingSource);
ModelBinding\Metadata\BindingSourceTest.cs (27)
15$"'{nameof(BindingSource.CanAcceptDataFrom)}' requires that the source must represent a single type of input."; 18bindingSources: new BindingSource[] { BindingSource.Query, BindingSource.Form }, 23() => BindingSource.Query.CanAcceptDataFrom(bindingSource), 28public static TheoryData<BindingSource> ModelBinding_MatchData 32return new TheoryData<BindingSource> 34BindingSource.Form, 35BindingSource.ModelBinding, 36BindingSource.Path, 37BindingSource.Query, 44public void ModelBinding_CanAcceptDataFrom_Match(BindingSource bindingSource) 47var result = BindingSource.ModelBinding.CanAcceptDataFrom(bindingSource); 57var result = BindingSource.Query.CanAcceptDataFrom(BindingSource.Query); 63public static TheoryData<BindingSource> ModelBinding_NoMatchData 67return new TheoryData<BindingSource> 69BindingSource.Body, 70BindingSource.Custom, 71BindingSource.FormFile, 72BindingSource.Header, 73BindingSource.Services, 74BindingSource.Special, 81public void ModelBinding_CanAcceptDataFrom_NoMatch(BindingSource bindingSource) 84var result = BindingSource.ModelBinding.CanAcceptDataFrom(bindingSource); 94var result = BindingSource.Query.CanAcceptDataFrom(BindingSource.Path);
ModelBinding\Metadata\CompositeBindingSourceTest.cs (14)
15bindingSources: new BindingSource[] { BindingSource.Query, BindingSource.Form }, 19bindingSources: new BindingSource[] { BindingSource.Query, BindingSource.Form }, 37bindingSources: new BindingSource[] { BindingSource.Query, BindingSource.Form }, 41var result = composite.CanAcceptDataFrom(BindingSource.Query); 52bindingSources: new BindingSource[] { BindingSource.Query, BindingSource.Form }, 56var result = composite.CanAcceptDataFrom(BindingSource.Path);
ModelBinding\Metadata\DefaultBindingMetadataProviderTest.cs (7)
111new BindingSourceModelBinderAttribute(BindingSource.Body), 112new BindingSourceModelBinderAttribute(BindingSource.Query), 125Assert.Equal(BindingSource.Body, context.BindingMetadata.BindingSource); 135new BindingSourceModelBinderAttribute(BindingSource.Body), 136new BindingSourceModelBinderAttribute(BindingSource.Query), 149Assert.Equal(BindingSource.Body, context.BindingMetadata.BindingSource); 894public BindingSourceModelBinderAttribute(BindingSource bindingSource)
ModelBinding\Metadata\ModelBinderAttributeTest.cs (9)
17var source = attribute.BindingSource; 33var source = attribute.BindingSource; 36Assert.Same(BindingSource.Custom, source); 46var source = attribute.BindingSource; 49Assert.Same(BindingSource.Custom, source); 62var source = attribute.BindingSource; 65Assert.Equal(BindingSource.Query, source); 70public override BindingSource BindingSource => BindingSource.Query;
ModelBinding\ModelBinderFactoryTest.cs (4)
296BindingSource = BindingSource.Services, 305BindingSource = BindingSource.ModelBinding, 310BindingSource = BindingSource.Services, 317BindingSource = BindingSource.Services,
ModelBinding\QueryStringValueProviderTest.cs (1)
13BindingSource bindingSource,
ModelBinding\RouteValueProviderTests.cs (17)
20var provider = new RouteValueProvider(BindingSource.Query, values); 37var provider = new RouteValueProvider(BindingSource.Query, values); 55var provider = new RouteValueProvider(BindingSource.Query, values); 72var provider = new RouteValueProvider(BindingSource.Query, values, new CultureInfo("de-CH")); 91var provider = new RouteValueProvider(BindingSource.Query, values); 108var provider = new RouteValueProvider(BindingSource.Query, values); 126var provider = new RouteValueProvider(BindingSource.Query, values, culture); 148var valueProvider = new RouteValueProvider(BindingSource.Query, values); 169var valueProvider = new RouteValueProvider(BindingSource.Query, values); 187var valueProvider = new RouteValueProvider(BindingSource.Query, values); 204var provider = new RouteValueProvider(BindingSource.Query, values); 221var provider = new RouteValueProvider(BindingSource.Query, values); 235var provider = new RouteValueProvider(BindingSource.Query, values); 237var bindingSource = new BindingSource( 238BindingSource.Query.Id, 256var provider = new RouteValueProvider(BindingSource.Query, values); 258var bindingSource = new BindingSource(
ModelBinding\TestValueProvider.cs (2)
10public static readonly BindingSource TestBindingSource = new BindingSource( 23public TestValueProvider(BindingSource bindingSource, IDictionary<string, object> values)
Microsoft.AspNetCore.Mvc.DataAnnotations.Test (1)
ModelMetadataProviderTest.cs (1)
924public BindingSource BindingSource { get; set; }
Microsoft.AspNetCore.Mvc.FunctionalTests (15)
ApiExplorerTest.cs (15)
979Assert.Equal(BindingSource.ModelBinding.Id, i.Source); 983Assert.Equal(BindingSource.ModelBinding.Id, s.Source); 1004Assert.Equal(BindingSource.Query.Id, i.Source); 1008Assert.Equal(BindingSource.Path.Id, s.Source); 1028Assert.Equal(BindingSource.ModelBinding.Id, id.Source); 1032Assert.Equal(BindingSource.ModelBinding.Id, name.Source); 1052Assert.Equal(BindingSource.Path.Id, id.Source); 1056Assert.Equal(BindingSource.Body.Id, product.Source); 1076Assert.Equal(BindingSource.Query.Id, customerId.Source); 1080Assert.Equal(BindingSource.Header.Id, referrer.Source); 1084Assert.Equal(BindingSource.Form.Id, quantity.Source); 1088Assert.Equal(BindingSource.Form.Id, productId.Source); 1092Assert.Equal(BindingSource.Form.Id, productName.Source); 1096Assert.Equal(BindingSource.Query.Id, shippingInstructions.Source); 1100Assert.Equal(BindingSource.Form.Id, feedback.Source);
Microsoft.AspNetCore.Mvc.IntegrationTests (42)
BodyValidationIntegrationTests.cs (11)
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 816.BindingDetails(binding => binding.BindingSource = BindingSource.Body); 862.BindingDetails(binding => binding.BindingSource = BindingSource.Body);
GenericModelBinderIntegrationTest.cs (4)
133public static readonly BindingSource Source = new BindingSource( 139public BindingSource BindingSource 152var allowedBindingSource = context.BindingInfo.BindingSource; 172var allowedBindingSource = bindingContext.BindingSource;
HeaderModelBinderIntegrationTest.cs (1)
270BindingSource = BindingSource.Header
ModelPrefixSelectionIntegrationTest.cs (3)
77BindingSource = BindingSource.Query, 165BindingSource = BindingSource.Query, 214BindingSource = BindingSource.Query,
ServicesModelBinderIntegrationTest.cs (10)
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, 390.BindingDetails(binding => binding.BindingSource = 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
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);
Microsoft.AspNetCore.Mvc.Test (5)
MvcOptionsSetupTest.cs (5)
176Assert.Equal(BindingSource.Special, specialParameter.BindingSource); 182Assert.Equal(BindingSource.FormFile, formFileParameter.BindingSource); 188Assert.Equal(BindingSource.FormFile, formCollectionParameter.BindingSource); 194Assert.Equal(BindingSource.FormFile, formFileParameter.BindingSource); 200Assert.Equal(BindingSource.FormFile, formFileParameter.BindingSource);
Microsoft.AspNetCore.OpenApi (14)
Extensions\ApiDescriptionExtensions.cs (6)
83apiParameterDescription.Source == BindingSource.Body || 84apiParameterDescription.Source == BindingSource.FormFile || 85apiParameterDescription.Source == BindingSource.Form; 95formParameters = apiDescription.ParameterDescriptions.Where(parameter => parameter.Source == BindingSource.Form || parameter.Source == BindingSource.FormFile); 108var bodyParameters = apiDescription.ParameterDescriptions.Where(parameter => parameter.Source == BindingSource.Body);
Extensions\JsonNodeSchemaExtensions.cs (6)
344static bool SupportsNullableProperty(BindingSource bindingSource) =>bindingSource == BindingSource.Header 345|| bindingSource == BindingSource.Query 346|| bindingSource == BindingSource.Path 347|| bindingSource == BindingSource.Form 348|| bindingSource == BindingSource.FormFile;
Services\OpenApiDocumentService.cs (2)
433else if (parameter.Source == BindingSource.Header && _disallowedHeaderParameters.Contains(parameter.Name)) 450return parameter.Source == BindingSource.Path || parameter.IsRequired || hasRequiredAttribute;