Was wondering if anyone could point me to docs and/or discussion regarding how best to setup a blazor project to more readily switch between server-side to client-side. For example in client side every call to the server might need to use HttpClient while on the server-side one could make direct calls to a class or EF to get data. I guess some form of data abstraction with a switch of some kind when client or server is detected? Any nudge in the right direction would be greatly appreciated. Thanks!
Quite related to: https://github.com/aspnet/Blazor.Docs/issues/301
Solution designed by @Suchiman is very clever and perfect if you want to quickly switch to server mode to debug your code in VS. It is good because your code is exactly the same in client and server mode. In server mode you still use HTTPClient. This is of course suboptimal and if you have your data directly accessible from the web server you probably want to create some data abstraction layer to achieve the best possible performance in production.
services.AddServerSideBlazor
Most helpful comment
Solution designed by @Suchiman is very clever and perfect if you want to quickly switch to server mode to debug your code in VS. It is good because your code is exactly the same in client and server mode. In server mode you still use HTTPClient. This is of course suboptimal and if you have your data directly accessible from the web server you probably want to create some data abstraction layer to achieve the best possible performance in production.