Search code examples
c#asp.net-coreblazor

How to add multiple Blazor web apps to existing Web API


I'm new to Blazor. I'm trying to understand how it works. We have multiple front-ends and an existing ASP.NET Core Web API (clean architecture).

What is the best way to add multiple Blazor web apps to an existing ASP.NET Core Web API ?


Solution

  • What is the best way to add multiple Blazor web apps to an existing ASP.NET Core Web API ?

    As marc_s said, its better to create spreate blazor project inside the same solution to achieve your requirement.

    Then these blazor projects could use httpclient to call the web api instead of merge all the client projects inside the same web api project which may caused hard to maintain the project later.

    Besides, choosing which blazor project should also according to your actually requirement. More details about what's the difference and how to choose it, you could refer to this article.

    For how to using the httpclient inside the blazor web app, I suggest you could refer to this article.