Search code examples
architecturedependenciesclientblazor-webassembly

Blazor WebAssembly Client project dependencies


This one pertains to Blazor WebAssembly (asp.net 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?


Solution

  • There is nothing wrong with

    "to create a similar enum type inside Shared project and map it to the Domain one on Server side"

    The Shared project is where your DTO's live, the common ground between Server and Client.
    What kind of classes is that enum in?