Blazor WebAssembly Client project dependencies

Posted 90 days ago by linas

This one pertains to Blazor WebAssembly ( core hosted).

I have an enum type that represents use cases an application supports. It lives inside Domain project since it is domain specific.

I want to use the enum from Blazor Client, but that requires referencing the Domain project (which is not recommended I guess?).

The only solution I see is to create a similar enum type inside Shared project and map it to the Domain one on Server side. This sounds inconvenient as I may end up with lots of types that are copies of those found in Domain.

What better solutions would you recommend?

  • 0

    You may want to place them in the Shared project instead of the Domain project, then just reference them in the Shared project throughout the application. I wouldn't reference the Domain project from your Blazor WebAssembly app, because I'm pretty sure it would upload the Domain .dll into the client, which someone could decompile if they wanted. Anything you place in the Shared project will be uploaded into the client.

    Posted 89 days ago by selliott
Someone is typing...

Post a Reply

You must be logged in to add a new post.
Number of online users: 2
An error has occurred. This application may no longer respond until reloaded. Reload 🗙