Hosted mode
In hosted mode do you need a rest end point (or other kind of transport mode) to access data and to invoke backend operations:
USER BACKEND
SIDE
HTTP
or other network
transport.
|
|
client ---- dto ---> rest api ----> server functions
(wasm)
|
|
Server side mode
In server side mode you don't need to access server data via rest api, your app is executing on the server, just inject service and call server functions directly, not through a network transport.
USER BACKEND
SIDE
SignalR
(websocket)
|
|
client <--- virtual dom changes ---> .razor pages ----> server functions
(html
+css |
+js) |
|
|
Bonus
To easily switch from hosted model to server side you can create an IServiceInterface
for both (server functions
and rest client transport class
) and use Dependency Injection to use one or other implementation on each scenario. Simplified:
hosted model
|
- rest client trans class----> web api ----
| (IServiceInterface) | |
Client - | |--> server functions
| | | (IServiceInterface)
------------------------------------------
|
server side model