SkywardApps / popcorn

Popcorn is a .Net Middleware for your RESTful API that allows your consumers to request exactly as much or as little as they need, with no effort from you.
https://skywardapps.github.io/popcorn/
MIT License
59 stars 19 forks source link

Allow optional parameter for ExpandResultAttribute #52

Closed maxstralin closed 5 years ago

maxstralin commented 5 years ago

Description

Allows for ExpandResultAttribute to accept an optional boolean parameter for specifying behavior, to expand result or to not expand result, which is then set as the value of the ExpandResultAttribute.ShouldExpand property. DoNotExpandResultAttribute now inherits from ExpandResultAttribute but always passing in false. The ExpandActionFilter has been updated to accommodate if ExpandResultAttribute.ShouldExpand is set to false.

Related Issue

Relevant issue

Motivation and Context

Relevant issue

How Has This Been Tested?

Tested with example projects. The attributes still have the same types (and default behavior) and won't break any code looking at the attribute types, if developers have custom logic written towards the types.

Screenshots (if appropriate):