31 references to EmptyBodyBehavior
FormatterWebSite (1)
Controllers\HomeController.cs (1)
46public IActionResult OptionalBody([FromBody(EmptyBodyBehavior = EmptyBodyBehavior.Allow)] DummyClass dummy)
Microsoft.AspNetCore.Mvc.Abstractions (4)
ModelBinding\BindingInfo.cs (3)
92public EmptyBodyBehavior EmptyBodyBehavior { get; set; } 260if (EmptyBodyBehavior == EmptyBodyBehavior.Default && 265EmptyBodyBehavior = EmptyBodyBehavior.Allow;
ModelBinding\IAllowEmptyInputInBodyModelBinding.cs (1)
8public EmptyBodyBehavior EmptyBodyBehavior { get; }
Microsoft.AspNetCore.Mvc.Abstractions.Test (6)
ModelBinding\BindingInfoTest.cs (6)
54new FromBodyAttribute { EmptyBodyBehavior = EmptyBodyBehavior.Allow }, 62Assert.Equal(EmptyBodyBehavior.Allow, bindingInfo.EmptyBodyBehavior); 129new FromBodyAttribute() { EmptyBodyBehavior = EmptyBodyBehavior.Disallow } 140Assert.Equal(EmptyBodyBehavior.Disallow, bindingInfo.EmptyBodyBehavior); 266Assert.Equal(EmptyBodyBehavior.Allow, bindingInfo.EmptyBodyBehavior); 288Assert.Equal(EmptyBodyBehavior.Default, bindingInfo.EmptyBodyBehavior);
Microsoft.AspNetCore.Mvc.ApiExplorer (2)
DefaultApiDescriptionProvider.cs (2)
303if (parameter.BindingInfo == null || parameter.BindingInfo.EmptyBodyBehavior == EmptyBodyBehavior.Default) 309parameter.IsRequired = !(parameter.BindingInfo.EmptyBodyBehavior == EmptyBodyBehavior.Allow);
Microsoft.AspNetCore.Mvc.ApiExplorer.Test (1)
DefaultApiDescriptionProviderTest.cs (1)
2055EmptyBodyBehavior = EmptyBodyBehavior.Allow,
Microsoft.AspNetCore.Mvc.Core (9)
ApplicationModels\InferParameterBindingInfoConvention.cs (2)
106fromBodyParameters[0].BindingInfo!.EmptyBodyBehavior == EmptyBodyBehavior.Default && 109fromBodyParameters[0].BindingInfo!.EmptyBodyBehavior = EmptyBodyBehavior.Allow;
FromBodyAttribute.cs (4)
52/// Specifying <see cref="EmptyBodyBehavior.Allow"/> or <see cref="EmptyBodyBehavior.Disallow" /> will override the framework defaults. 54public EmptyBodyBehavior EmptyBodyBehavior { get; set; } 58bool IFromBodyMetadata.AllowEmpty => EmptyBodyBehavior == EmptyBodyBehavior.Allow;
ModelBinding\Binders\BodyModelBinderProvider.cs (3)
94internal static bool CalculateAllowEmptyBody(EmptyBodyBehavior emptyBodyBehavior, MvcOptions? options) 96if (emptyBodyBehavior == EmptyBodyBehavior.Default) 101return emptyBodyBehavior == EmptyBodyBehavior.Allow;
Microsoft.AspNetCore.Mvc.Core.Test (8)
ApplicationModels\InferParameterBindingInfoConventionTest.cs (4)
130Assert.Equal(EmptyBodyBehavior.Default, bindingInfo.EmptyBodyBehavior); 164Assert.Equal(EmptyBodyBehavior.Default, bindingInfo.EmptyBodyBehavior); 190Assert.Equal(EmptyBodyBehavior.Allow, bindingInfo.EmptyBodyBehavior); 216Assert.Equal(EmptyBodyBehavior.Allow, bindingInfo.EmptyBodyBehavior);
ModelBinding\Binders\BodyModelBinderProviderTest.cs (4)
92var allowEmpty = BodyModelBinderProvider.CalculateAllowEmptyBody(EmptyBodyBehavior.Default, options); 102var allowEmpty = BodyModelBinderProvider.CalculateAllowEmptyBody(EmptyBodyBehavior.Default, options: null); 112var allowEmpty = BodyModelBinderProvider.CalculateAllowEmptyBody(EmptyBodyBehavior.Allow, options: new MvcOptions()); 126var allowEmpty = BodyModelBinderProvider.CalculateAllowEmptyBody(EmptyBodyBehavior.Disallow, options);