Blazor United: Auto Generate API Layer and Frontend actions, so that a single component can work in both server and client render modes #47529
Labels
area-mvc
Includes: MVC, Actions and Controllers, Localization, CORS, most templates
✔️ Resolution: Duplicate
Resolved as a duplicate of another issue
Status: Resolved
Is there an existing issue for this?
Is your feature request related to a problem? Please describe the problem.
No response
Describe the solution you'd like
I added a comment about this, but just re-iterating it here for more visibility: #46636 (comment)
Hey All! Not sure if this is discussed / requested anywhere, but is it possible to have both the API layer and the frontend glue code calling the API layer auto generated?
What I am thinking here is to have methods defined with data attributes like: "[ServerOnly] [API]" or something which will ensure these methods are only run on the server and the framework can auto generate the API layer for these methods and also generate the frontend glue code ( potentially using source generators? )
This way we can have a single component work in both server render mode ( any action calls the method directly ) and client render mode ( any action calls the auto generated API client )
Additional context
No response
The text was updated successfully, but these errors were encountered: