1 type derived from BindingSource
Microsoft.AspNetCore.Mvc.Abstractions (1)
ModelBinding\CompositeBindingSource.cs (1)
12public class CompositeBindingSource : BindingSource
10 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(
191 references to BindingSource
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.ApiExplorer (37)
DefaultApiDescriptionProvider.cs (20)
139if (parameter.Source == BindingSource.Body) 149else if (parameter.Source == BindingSource.FormFile) 254if (parameter.Source == BindingSource.Path || 255parameter.Source == BindingSource.ModelBinding || 256parameter.Source == BindingSource.Custom) 263if (parameter.Source == BindingSource.ModelBinding && 268parameter.Source = BindingSource.Path; 273if (parameter.Source == BindingSource.Path && 296Source = BindingSource.Path, 305if (parameter.Source == BindingSource.Body) 322if (parameter.Source == BindingSource.Path && parameter.RouteInfo != null) 345if (parameter.Source == BindingSource.Path) 534public BindingSource? BindingSource { get; } 578var source = BindingSource.ModelBinding; 584BindingSource ambientSource, 587var source = bindingContext.BindingSource; 671BindingSource source, 708public readonly BindingSource? Source; 710public PropertyKey(ModelMetadata metadata, BindingSource? source)
EndpointMetadataApiDescriptionProvider.cs (16)
128parameterDescription.Source == BindingSource.Body || 129parameterDescription.Source == BindingSource.FormFile; 148Source = BindingSource.Body, 178if (source == BindingSource.Services) 251private (BindingSource, string, bool, Type) GetBindingSourceAndName(IParameterBindingMetadata parameter, RouteEndpoint routeEndpoint, bool disableInferredBody) 260return (BindingSource.Path, routeAttribute.Name ?? name, false, parameterType); 264return (BindingSource.Query, queryAttribute.Name ?? parameter.Name ?? string.Empty, false, parameterType); 268return (BindingSource.Header, headerAttribute.Name ?? parameter.Name ?? string.Empty, false, parameterType); 272return (BindingSource.Body, parameter.Name ?? string.Empty, fromBodyAttribute.AllowEmpty, parameterType); 276return (BindingSource.FormFile, fromFormAttribute.Name ?? parameter.Name ?? string.Empty, false, parameterType); 287return (BindingSource.Services, parameter.Name ?? string.Empty, false, parameterType); 297return (BindingSource.Path, routeParam.Name, false, displayType); 301return (BindingSource.Query, parameter.Name ?? string.Empty, false, displayType); 306return (BindingSource.FormFile, parameter.Name ?? string.Empty, false, parameterType); 313return (BindingSource.Query, parameter.Name ?? string.Empty, false, parameterType); 317return (BindingSource.Body, parameter.Name ?? string.Empty, false, parameterType);
EndpointModelMetadata.cs (1)
21public override BindingSource? BindingSource { get; }
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,