105 references to Body
FormatterWebSite (1)
ValidateBodyParameterAttribute.cs (1)
46
return bindingSource?.CanAcceptDataFrom(BindingSource.
Body
) ?? false;
Microsoft.AspNetCore.Grpc.Swagger (1)
Internal\GrpcJsonTranscodingDescriptionProvider.cs (1)
141
Source = 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)
261
BindingSource == BindingSource.
Body
&&
Microsoft.AspNetCore.Mvc.ApiExplorer (6)
DefaultApiDescriptionProvider.cs (2)
135
if (parameter.Source == BindingSource.
Body
)
301
if (parameter.Source == BindingSource.
Body
)
EndpointMetadataApiDescriptionProvider.cs (4)
127
parameterDescription.Source == BindingSource.
Body
||
147
Source = BindingSource.
Body
,
271
return (BindingSource.
Body
, parameter.Name ?? string.Empty, fromBodyAttribute.AllowEmpty, parameterType);
316
return (BindingSource.
Body
, parameter.Name ?? string.Empty, false, parameterType);
Microsoft.AspNetCore.Mvc.ApiExplorer.Test (11)
DefaultApiDescriptionProviderTest.cs (7)
1406
Assert.Same(BindingSource.
Body
, parameter.Source);
1558
Assert.Same(BindingSource.
Body
, product.Source);
1746
Assert.Same(BindingSource.
Body
, product.Source);
2006
Assert.Same(BindingSource.
Body
, product.Source);
2022
var description = new ApiParameterDescription { Source = BindingSource.
Body
, };
2036
var description = new ApiParameterDescription { Source = BindingSource.
Body
, };
2052
Source = BindingSource.
Body
,
EndpointMetadataApiDescriptionProviderTest.cs (4)
559
Assert.Equal(BindingSource.
Body
, param.Source);
601
Assert.Equal(BindingSource.
Body
, param.Source);
641
Assert.Equal(BindingSource.
Body
, fromBodyParam.Source);
672
Assert.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>
92
var fromBodyParameters = action.Parameters.Where(p => p.BindingInfo!.BindingSource == BindingSource.
Body
).ToList();
123
return metadata.BoundProperties.Any(prop => prop.BindingSource is not null) ? null : BindingSource.
Body
;
FromBodyAttribute.cs (1)
44
public 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)
73
context.BindingInfo.BindingSource.CanAcceptDataFrom(BindingSource.
Body
))
Microsoft.AspNetCore.Mvc.Core.Test (50)
ApplicationModels\ApiBehaviorApplicationModelProviderTest.cs (2)
78
Assert.Equal(BindingSource.
Body
, parameterModel.BindingInfo.BindingSource);
121
Assert.Equal(BindingSource.
Body
, parameterModel.BindingInfo.BindingSource);
ApplicationModels\ControllerActionDescriptorProviderTests.cs (2)
155
Assert.Equal(entity.BindingInfo.BindingSource, BindingSource.
Body
);
207
Assert.Equal(entity.BindingInfo.BindingSource, BindingSource.
Body
);
ApplicationModels\InferParameterBindingInfoConventionTest.cs (11)
131
Assert.Same(BindingSource.
Body
, bindingInfo.BindingSource);
165
Assert.Same(BindingSource.
Body
, bindingInfo.BindingSource);
191
Assert.Same(BindingSource.
Body
, bindingInfo.BindingSource);
217
Assert.Same(BindingSource.
Body
, bindingInfo.BindingSource);
341
Assert.Same(BindingSource.
Body
, result);
506
Assert.Same(BindingSource.
Body
, result);
528
Assert.Same(BindingSource.
Body
, model.BindingInfo.BindingSource);
561
Assert.Same(BindingSource.
Body
, result);
576
Assert.Same(BindingSource.
Body
, result);
591
Assert.Same(BindingSource.
Body
, result);
606
Assert.Same(BindingSource.
Body
, result);
ApplicationModels\ParameterModelTest.cs (1)
21
BindingSource = BindingSource.
Body
Controllers\ControllerBinderDelegateProviderTest.cs (2)
1095
BindingSource = BindingSource.
Body
1107
BindingSource = BindingSource.
Body
ModelBinding\Binders\BodyModelBinderProviderTest.cs (3)
49
context.BindingInfo.BindingSource = BindingSource.
Body
;
62
context.BindingInfo.BindingSource = BindingSource.
Body
;
76
context.BindingInfo.BindingSource = BindingSource.
Body
;
ModelBinding\Binders\BodyModelBinderTests.cs (22)
34
provider.ForType<Person>().BindingDetails(d => d.BindingSource = BindingSource.
Body
);
56
provider.ForType<Person>().BindingDetails(d => d.BindingSource = BindingSource.
Body
);
80
provider.ForType<Person>().BindingDetails(d => d.BindingSource = BindingSource.
Body
);
105
provider.ForType<Person>().BindingDetails(d => d.BindingSource = BindingSource.
Body
);
132
d.BindingSource = BindingSource.
Body
;
173
provider.ForType<Person>().BindingDetails(d => d.BindingSource = BindingSource.
Body
);
201
provider.ForType<Person>().BindingDetails(d => d.BindingSource = BindingSource.
Body
);
229
provider.ForType<Person>().BindingDetails(d => d.BindingSource = BindingSource.
Body
);
257
metadataProvider.ForType<Person>().BindingDetails(d => d.BindingSource = BindingSource.
Body
);
305
metadataProvider.ForType<Person>().BindingDetails(d => d.BindingSource = BindingSource.
Body
);
334
metadataProvider.ForType<Person>().BindingDetails(d => d.BindingSource = BindingSource.
Body
);
376
metadataProvider.ForType<Person>().BindingDetails(d => d.BindingSource = BindingSource.
Body
);
405
metadataProvider.ForType<Person>().BindingDetails(d => d.BindingSource = BindingSource.
Body
);
452
metadataProvider.ForType<Person>().BindingDetails(d => d.BindingSource = BindingSource.
Body
);
487
metadataProvider.ForType<Person>().BindingDetails(d => d.BindingSource = BindingSource.
Body
);
516
metadataProvider.ForType<Person>().BindingDetails(d => d.BindingSource = BindingSource.
Body
);
539
provider.ForType<Person>().BindingDetails(d => d.BindingSource = BindingSource.
Body
);
577
provider.ForType<Person>().BindingDetails(d => d.BindingSource = BindingSource.
Body
);
602
provider.ForType<Person>().BindingDetails(d => d.BindingSource = BindingSource.
Body
);
631
provider.ForType<Person>().BindingDetails(d => d.BindingSource = BindingSource.
Body
);
663
provider.ForType<Person>().BindingDetails(d => d.BindingSource = BindingSource.
Body
);
701
BindingSource = BindingSource.
Body
,
ModelBinding\Binders\HeaderModelBinderProviderTest.cs (1)
20
BindingSource.
Body
,
ModelBinding\BindingSourceValueProviderTest.cs (1)
56
var result = valueProvider.Filter(BindingSource.
Body
);
ModelBinding\Metadata\BindingSourceTest.cs (1)
69
BindingSource.
Body
,
ModelBinding\Metadata\DefaultBindingMetadataProviderTest.cs (4)
111
new BindingSourceModelBinderAttribute(BindingSource.
Body
),
125
Assert.Equal(BindingSource.
Body
, context.BindingMetadata.BindingSource);
135
new BindingSourceModelBinderAttribute(BindingSource.
Body
),
149
Assert.Equal(BindingSource.
Body
, context.BindingMetadata.BindingSource);
Microsoft.AspNetCore.Mvc.FunctionalTests (1)
ApiExplorerTest.cs (1)
1056
Assert.Equal(BindingSource.
Body
.Id, product.Source);
Microsoft.AspNetCore.Mvc.IntegrationTests (24)
BodyValidationIntegrationTests.cs (11)
29
BindingSource = BindingSource.
Body
71
BindingSource = BindingSource.
Body
,
103
BindingSource = BindingSource.
Body
153
BindingSource = BindingSource.
Body
194
BindingSource = BindingSource.
Body
234
BindingSource = BindingSource.
Body
270
BindingSource = BindingSource.
Body
315
BindingSource = BindingSource.
Body
405
BindingSource = BindingSource.
Body
816
.BindingDetails(binding => binding.BindingSource = BindingSource.
Body
);
862
.BindingDetails(binding => binding.BindingSource = BindingSource.
Body
);
SimpleTypeModelBinderIntegrationTest.cs (1)
288
BindingSource = BindingSource.
Body
,
ValidationIntegrationTests.cs (6)
57
BindingSource = BindingSource.
Body
69
BindingSource = BindingSource.
Body
1783
BindingSource = BindingSource.
Body
1873
BindingSource = BindingSource.
Body
1919
BindingSource = BindingSource.
Body
1974
BindingSource = BindingSource.
Body
ValidationWithRecordIntegrationTests.cs (6)
49
BindingSource = BindingSource.
Body
61
BindingSource = BindingSource.
Body
1586
BindingSource = BindingSource.
Body
1676
BindingSource = BindingSource.
Body
1722
BindingSource = BindingSource.
Body
1773
BindingSource = BindingSource.
Body
Microsoft.AspNetCore.OpenApi (2)
Extensions\ApiDescriptionExtensions.cs (2)
83
apiParameterDescription.Source == BindingSource.
Body
||
108
var bodyParameters = apiDescription.ParameterDescriptions.Where(parameter => parameter.Source == BindingSource.
Body
);