How to add the response header to only one endpoint #261
-
Hi. So, I have come up with two ways. The first one is to define it in The second one is to create a custom API by creating a partial class in the Controller. Any good ideas on this🤔 |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Hi @Kazunari001, your thinking above is on the right track. Beef is/was never intended to be an all-in proposition, but a means to industrialize the most common patterns. Therefore, the Depending on your needs, you may still want the other layers code-generated with your custom Finally, this is a bit more hacky but is another means to achieve your goal. Version Personally, I prefer the first version, as that avoids having ASP.NET Web Api types used inside of business logic, and the intent within the Hope this helps, |
Beta Was this translation helpful? Give feedback.
Hi @Kazunari001, your thinking above is on the right track. Beef is/was never intended to be an all-in proposition, but a means to industrialize the most common patterns. Therefore, the
Controller
class is madepartial
to enable you as the developer to extend capabilities where the Beef out-of-the-box is not appropriate.Depending on your needs, you may still want the other layers code-generated with your custom
Controller
logic invoking. If this is the case, then addexcludeWebApi: true
to theoperation
code-gen configuration. FYI: there is documentation for all of the possible code-gen configurations; see here.Finally, this is a bit more hacky but is another means to achieve your goal.…