Even though the groundbreaking .NET Core 3.0 is nearing general availability and the dev team has switched gears to focus on stability and reliability, new tweaks and enhancements are still appearing in the latest preview 8.
With .NET Core 3.0 becoming production-ready and transitioning from new features to a focus on stability and reliability in Preview 7, Microsoft has detailed a slew of new features for the ASP.NET and Blazor components.
You have two tools for generating your initial UI in a Blazor component: ASP.NET's Razor and Blazor's RenderFragment. Here's how to use both to integrate with your C# code (and a warning about what you can't do).
The beauty of a tag helper is it's ability to add new HTML to your page. Once you know what you want to change, here are the tools to change the HTML going to the user.
You can create your own custom tag helpers ... but it's a lot easier if you understand the process that tag helpers need to go through. Here are your options when gathering the data that a tag helper needs (and why they can't completely replace HtmlHelpers).
Whenever you have repeated HTML, you should be creating your own tag helpers to simplify your views. Here's how flexible tag helpers can be when you go to integrate them into your page.
Microsoft shipped ASP.NET Core 3.0 Preview 6, with the red-hot Blazor project getting built-in support for handling authentication and authorization, among other updates.
The hottest NuGet extensions for the hottest ASP.NET Core project.
If you want to add server-side Blazor to your existing ASP.NET Core applications, you can. There's not much to it, fortunately. In fact, there's probably more work involved in creating a View or Page that will play well with your component
Eric Vogel kicks off his series on ASP.NET Core security by showing how to set up authentication to register, log in and log out a user account in an ASP.NET Core MVC application.
After this week's release of Visual Studio 2019, Microsoft exec Scott Hunter detailed many of the new features coming in .NET Core 3, already available as a preview in VS 2019 so developers can try it out (with a simple tweak).
Blazor, like most systems for generating Web pages, supports using layout pages for repeated content. Here's what works, what doesn't (yet) work and work-arounds I've discovered for what doesn't work.
The reality is that you will need to have, at least, two different configurations: one for production and one for development. Here's how to automate those conversions.
If you move beyond the basics of working with Razor Pages, there are at least two things you should know to support creating Pages that do more than one thing and integrate with existing code.
If you're moving your application's client-side code to Blazor, then you'll want Blazor to manage navigating between pages, too.
There are lots of ways to handle databases in a containerized environment like Docker. Here's how to create SQL Server in a container, how to load it with the data you want and how to integrate that container into whatever project needs it. Be warned: Some PowerShell is used.
Here's how to run a "real-world" application (consisting of an MVC application and a Web Service) in a networked set of Docker containers. And it's just a couple of mouse clicks in Visual Studio to implement it.
If you want to handle the most common pattern in ASP.NET Controllers (displaying a page and then accepting data entered into it), you can do it with Razor Pages. You'll just need less code than if you used a Controller, a View and a model object.