Relative Content

Tag Archive for blazorblazor-webassembly

Is this a good way to organise API calls in Blazor?

I’m writing a blazor WASM app, and found myself writing the same boilerplate code for notifying errors in API calls over and over, making my code messy and hard to read. I’m thinking of replacing that repeated code with calls to this, but I’m new to Blazor and I’m not sure whether I’m making a mistake here. Could anyone who knows more than I do have a look and let me know if you think this is a reasonable plan?
I’ve created a Scoped service, which I inject in program.cs