Skip to content

Blazor United: Auto Generate API Layer and Frontend actions, so that a single component can work in both server and client render modes #47529

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
1 task done
MacdonaldRobinson opened this issue Apr 1, 2023 · 1 comment
Labels
area-mvc Includes: MVC, Actions and Controllers, Localization, CORS, most templates ✔️ Resolution: Duplicate Resolved as a duplicate of another issue Status: Resolved

Comments

@MacdonaldRobinson
Copy link

Is there an existing issue for this?

  • I have searched the existing issues

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

@dotnet-issue-labeler dotnet-issue-labeler bot added the area-mvc Includes: MVC, Actions and Controllers, Localization, CORS, most templates label Apr 1, 2023
@MackinnonBuck
Copy link
Member

Thanks for reaching out! This is something we're considering and tracking in #46400. Going to close this issue as a duplicate.

@MackinnonBuck MackinnonBuck closed this as not planned Won't fix, can't repro, duplicate, stale Apr 3, 2023
@MackinnonBuck MackinnonBuck added the ✔️ Resolution: Duplicate Resolved as a duplicate of another issue label Apr 3, 2023
@ghost ghost added the Status: Resolved label Apr 3, 2023
@ghost ghost locked as resolved and limited conversation to collaborators May 3, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-mvc Includes: MVC, Actions and Controllers, Localization, CORS, most templates ✔️ Resolution: Duplicate Resolved as a duplicate of another issue Status: Resolved
Projects
None yet
Development

No branches or pull requests

2 participants