dotnet / aspnetcore

ASP.NET Core is a cross-platform .NET framework for building modern cloud-based web applications on Windows, Mac, or Linux.
https://asp.net
MIT License
35.58k stars 10.06k forks source link

Data loading without needing a server API endpoint #46400

Open mkArtakMSFT opened 1 year ago

mkArtakMSFT commented 1 year ago

With .NET running on both ends of the wire in a Blazor app, we have the opportunity to dramatically simplify data access with a strongly typed programming model. This issue tracks exploring adding a streamlined programming model for loading and manipulating data from the client.

jeffreypalermo commented 1 year ago

I am very interested in this. I have created a pattern that lets me do this constrained by the current APIs. I made a video about it here. https://www.youtube.com/watch?v=PsmXZnvWfIo

Ali1Jamal commented 11 months ago

yes the hole idea of blazor server is we can code the backend and frontend in one single project without need to create backend with webapi and then make request from blazor server to webapi , blazor server is solved that problem . but in .net 8 we have the auto render mode which is not actually make benefit for me because this mode require to use webapi . so i'm stick with blazor interactive server, but we can make blazor more more powerful, if we can have one blazor project that we can code backend and we can use Auto render mode with it, To achieve this there is a suggestion in my mind: 1- every method in . razor will be shared for wasm (client), and interactive server mode. 2-if any method have [ServerOnly] attribute in . razor it will be in server only and to get access to this method from wasm(client) we need generate this method as endpoint and get access to it (this can achieve by webapi or signalr) if you guys choose signalR then make the signalR if its lost the cirecit then create new one automatically without need to refresh the website (because its for endpoints only and will not effect the state of blazor). I hope something similar to this will be done in .net 9.

ghost commented 11 months ago

We've moved this issue to the Backlog milestone. This means that it is not going to be worked on for the coming release. We will reassess the backlog following the current release and consider this item at that time. To learn more about our issue management process and to have better expectation regarding different types of issues you can read our Triage Process.

AndrewBabbitt97 commented 1 week ago

@mkArtakMSFT This doesn't seem to have been touched in a while, is there any plans to look at this for the .NET 10 cycle? This feels like the last step to making Blazor Web Apps really nice from a DX perspective. Data access feels cumbersome to implement when using multiple render modes.