0

I am building a cross-platform application and have planned to use Blazor. I have made similar applications in the past but using ASP.Net Core for the back-end and Angular for the front-end. I always had a strong separation between the front and back-end in those applications, which is always good. The back-end was written as a ASP.Net Core Web API, and the front-end communicated with it through a REST API.

Now I have read a lot about Blazor from the Microsoft docs, and as far as I understood, it could be a potential alternative to Angular. However, I am not so sure how I could separate the front-end and back-end in this scenario.

Does it make sense also to create a back-end as I used to and create the front-end in Blazor, which would communicate with the back-end through the REST API, or is this not ideal?

2
  • This Microsoft article describes the architecture in sufficient detail to help you decide. May 17 at 13:53
  • is blazor really cross-platform, or does it devolve into server side rendering if you want your app to work on more than edge?
    – Ewan
    May 17 at 18:47

1 Answer 1

1

I'm going to focus on Blazor WebAssembly here, not Blazor Server-Side, because you're trying to compare it to an Angular frontend.

However, I am not so sure how I could separate the front-end and back-end in this scenario.

I'm not quite sure why you're assuming the separation that you'd otherwise have would be any different when you introduce Blazor.
In the end, you're still going to end up with some kind of webpage loaded into the user's browser, a backend server which serves that webpage, and communication happening between the two.

The only thing Blazor changes is what language you use for the development of your frontend app. It does not change the fact that your frontend site needs to contact your REST api in order to receive the information to display. Just because your frontend app is written with C# does not mean that it will also e.g. connect directly to your database the same way your backend C# code would.

The short answer here is that you could freely substitute any Angular app with a Blazor app without needing to worry about your architecture being any different.

1
  • Thanks for the clarification. I thought blazor could be a substitute for angular, but I wasn't sure. May 18 at 14:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.