105 references to Body
FormatterWebSite (1)
ValidateBodyParameterAttribute.cs (1)
46return bindingSource?.CanAcceptDataFrom(BindingSource.Body) ?? false;
Microsoft.AspNetCore.Grpc.Swagger (1)
Internal\GrpcJsonTranscodingDescriptionProvider.cs (1)
141Source = BindingSource.Body,
Microsoft.AspNetCore.Mvc.Abstractions (2)
ApiExplorer\ApiParameterDescription.cs (1)
55/// <item><description>it's bound from the request body (<see cref="BindingSource.Body"/>).</description></item>
ModelBinding\BindingInfo.cs (1)
261BindingSource == BindingSource.Body &&
Microsoft.AspNetCore.Mvc.ApiExplorer (6)
DefaultApiDescriptionProvider.cs (2)
135if (parameter.Source == BindingSource.Body) 301if (parameter.Source == BindingSource.Body)
EndpointMetadataApiDescriptionProvider.cs (4)
127parameterDescription.Source == BindingSource.Body || 147Source = BindingSource.Body, 271return (BindingSource.Body, parameter.Name ?? string.Empty, fromBodyAttribute.AllowEmpty, parameterType); 316return (BindingSource.Body, parameter.Name ?? string.Empty, false, parameterType);
Microsoft.AspNetCore.Mvc.ApiExplorer.Test (11)
DefaultApiDescriptionProviderTest.cs (7)
1406Assert.Same(BindingSource.Body, parameter.Source); 1558Assert.Same(BindingSource.Body, product.Source); 1746Assert.Same(BindingSource.Body, product.Source); 2006Assert.Same(BindingSource.Body, product.Source); 2022var description = new ApiParameterDescription { Source = BindingSource.Body, }; 2036var description = new ApiParameterDescription { Source = BindingSource.Body, }; 2052Source = BindingSource.Body,
EndpointMetadataApiDescriptionProviderTest.cs (4)
559Assert.Equal(BindingSource.Body, param.Source); 601Assert.Equal(BindingSource.Body, param.Source); 641Assert.Equal(BindingSource.Body, fromBodyParam.Source); 672Assert.Equal(BindingSource.Body, param.Source);
Microsoft.AspNetCore.Mvc.Core (7)
ApiBehaviorOptions.cs (1)
45/// Parameters that are complex (<see cref="ModelMetadata.IsComplexType"/>) are assumed to be bound from the body (<see cref="BindingSource.Body"/>).
ApplicationModels\InferParameterBindingInfoConvention.cs (3)
21/// <item>A complex type parameter (<see cref="ModelMetadata.IsComplexType"/>), not registered in the DI container, is assigned <see cref="BindingSource.Body"/>.</item> 92var fromBodyParameters = action.Parameters.Where(p => p.BindingInfo!.BindingSource == BindingSource.Body).ToList(); 123return metadata.BoundProperties.Any(prop => prop.BindingSource is not null) ? null : BindingSource.Body;
FromBodyAttribute.cs (1)
44public BindingSource BindingSource => BindingSource.Body;
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))
Microsoft.AspNetCore.Mvc.Core.Test (50)
ApplicationModels\ApiBehaviorApplicationModelProviderTest.cs (2)
78Assert.Equal(BindingSource.Body, parameterModel.BindingInfo.BindingSource); 121Assert.Equal(BindingSource.Body, parameterModel.BindingInfo.BindingSource);
ApplicationModels\ControllerActionDescriptorProviderTests.cs (2)
155Assert.Equal(entity.BindingInfo.BindingSource, BindingSource.Body); 207Assert.Equal(entity.BindingInfo.BindingSource, BindingSource.Body);
ApplicationModels\InferParameterBindingInfoConventionTest.cs (11)
131Assert.Same(BindingSource.Body, bindingInfo.BindingSource); 165Assert.Same(BindingSource.Body, bindingInfo.BindingSource); 191Assert.Same(BindingSource.Body, bindingInfo.BindingSource); 217Assert.Same(BindingSource.Body, bindingInfo.BindingSource); 341Assert.Same(BindingSource.Body, result); 506Assert.Same(BindingSource.Body, result); 528Assert.Same(BindingSource.Body, model.BindingInfo.BindingSource); 561Assert.Same(BindingSource.Body, result); 576Assert.Same(BindingSource.Body, result); 591Assert.Same(BindingSource.Body, result); 606Assert.Same(BindingSource.Body, result);
ApplicationModels\ParameterModelTest.cs (1)
21BindingSource = BindingSource.Body
Controllers\ControllerBinderDelegateProviderTest.cs (2)
1095BindingSource = BindingSource.Body 1107BindingSource = BindingSource.Body
ModelBinding\Binders\BodyModelBinderProviderTest.cs (3)
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\HeaderModelBinderProviderTest.cs (1)
20BindingSource.Body,
ModelBinding\BindingSourceValueProviderTest.cs (1)
56var result = valueProvider.Filter(BindingSource.Body);
ModelBinding\Metadata\BindingSourceTest.cs (1)
69BindingSource.Body,
ModelBinding\Metadata\DefaultBindingMetadataProviderTest.cs (4)
111new BindingSourceModelBinderAttribute(BindingSource.Body), 125Assert.Equal(BindingSource.Body, context.BindingMetadata.BindingSource); 135new BindingSourceModelBinderAttribute(BindingSource.Body), 149Assert.Equal(BindingSource.Body, context.BindingMetadata.BindingSource);
Microsoft.AspNetCore.Mvc.FunctionalTests (1)
ApiExplorerTest.cs (1)
1056Assert.Equal(BindingSource.Body.Id, product.Source);
Microsoft.AspNetCore.Mvc.IntegrationTests (24)
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);
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.OpenApi (2)
Extensions\ApiDescriptionExtensions.cs (2)
83apiParameterDescription.Source == BindingSource.Body || 108var bodyParameters = apiDescription.ParameterDescriptions.Where(parameter => parameter.Source == BindingSource.Body);