The best way to pass data between Blazor pages is by registering a singleton service and injecting it as a dependency onto the pages or components that need it. In this tutorial, you will create a C# class, register it as a service in your Blazor app, inject an instance of the service onto your pages, and use the service to share data across Blazor components.
we’ll use xUnit and write some unit tests for the ProxiedApiRouteEndpointLookup we’ve played around with in the last episode. We’re not going into much complexity, if for nothing else, because the class we’ll be testing is rather simple. In future episodes, with more complex code to test, we’ll revisit the topic and look at some other testing possibilities/needs (e.g. mocking).
Real world Microsoft workloads have a lot of Web APIs that are native to Microsoft methods for serving front-end applications (like ASP.NET, ASP.NET Razor/MVC, ReactJS or Angular Application). Even though there are customers who want to try serverless with AWS Lambda, they often have to continue to maintain many existing .NET web APIs. These applications traditionally talk to Microsoft SQL Server database for CRUD operations. This blog is for application teams that are migrating from traditional
When it comes to controlling which users can access which functionality in a Blazor application you not only have access to all of the user’s authentication you can authorize the user’s actions without writing any code.
Whether you are doing micro-services or mid-size monolith applications that do not have to be too distributed, there is a big chance that you will depend on some external HTTP service. Whether it is REST, SOAP or any other type of the response, your application flow depends on it's response.
We are going to start by looking into what the AutoMapper is and what problem it solves. Then, we are going to explain how we can use AutoMapper in our application. After that, we’ll learn about the usage guidelines and best practices. We’ll also take a look at what’s happening behind the scenes and how to flatten complex object models.
By default, JSON in ASP.NET Core will not be formatted at all. By that I mean, the JSON is returned without any spacing or formatting, and in the cheapest way possible (from a “bytes-sent-over-the-wire” perspective).