Do you share common types and logic in Blazor?

Last updated by Brady Stroud [SSW] about 1 year ago.See history

Due to Blazor using C#, your client and server can share the same model library - sharing behavior and data.

This will reduce the amount of code you need to write, and make it easier to maintain.

To share your classes between the client and server, just create a class library and reference it in your client and server projects.

See Blazor Code Sharing Example as an example.

References

We open source. Powered by GitHub