Hey Reader,
Today, we're diving into two burning questions that have been on a lot of your minds: How to implement Clean Architecture in a Blazor Web App and whether Blazor is viable in the industry.
In my newest video tutorial, I break down the essentials of setting up a Clean Architecture for your Blazor Web App in Visual Studio. We'll explore the four layers - Domain, Application, Infrastructure, and Presentation - and how they seamlessly integrate.
Here's what you need to know:
Start with a blank solution in Visual Studio and create a "src" folder for all your projects.
Begin layering by setting up three class library projects: "Domain," "Application," "Infrastructure". For the Presentation layer, kick off a new project with the "Blazor Web App" template, which will then be the starting project.
With Clean Architecture, each layer points inwards to ensure separation of concerns. A common industry practice allows the presentation layer to directly reference the infrastructure layer.
Ensure proper project referencing: Application refers to Domain, Infrastructure to Application, and Presentation to Infrastructure (taking the shortcut here).
For service registration, don't bunch it all in the Presentation layer's Program.cs. Add a DependencyInjection.cs file in both Application and Infrastructure layers with an extension method for the IServiceCollection. Invoke this in the Presentation layer's Program.cs.
That's it!
A lot of you have been asking if people really use Blazor for real work.
The story of BurnRate, run by .NET expert Robert McLaws, shows that yes, they do.
Instead of using complicated Excel sheets, BurnRate uses a smart "People Algorithm" with the help of Blazor and ASP.NET. This makes their website able to handle detailed financial stuff easily.
It's a great example of how Blazor is good for making reliable, ready-for-business apps. Check out how BurnRate uses Blazor here: BurnRate is fueling revenue success with Blazor.
Thank you immensely for your enthusiasm and support for the .NET Web Academy. Just a friendly reminder, enrollment is open for just one more week. Secure your place now at https://learn.dotnetwebacademy.com.
Have questions or need clarifications? Don't hesitate to hit reply to this email. I'm here to support with more tutorials if needed.
A big thank you to our incredible community and my Patrons for your steadfast support. You're the backbone of this newsletter and my channel. Stay safe, and remember, joy is found in coding! π»
Take care,
Patrick
Become a .NET & Blazor expert with weekly tutorials featuring best practices and the latest improvements, right in your inbox.
Hey Reader, In my last videos, we built a solid CRUD API using Vertical Slice Architecture, Minimal APIs, and Carter - super clean and modern. But thereβs still one problem... π What happens when a user sends empty or invalid data? In this new YouTube tutorial, Iβll show you how to fix that with: And yep, the full source code is free to download. Just check the link in the video description. If youβve been enjoying this Vertical Slice series, this is a must-watch. Itβs a simple upgrade that...
Hey Reader, If you're building apps with Blazor, you've probably asked yourself this: π Should I use SSR, Blazor Server, or WebAssembly? Itβs a common question - and I get it a lot. So I made a brand-new YouTube video walking you through how to choose the best one for your app. π₯ Watch it here: If you're building a Blazor app or planning to do so soon, this should help clear up a lot of confusion. Let me know what you think, and feel free to reply if you have any questions. Take care, Patrick...
Hey Reader, You may have seen the recent blog post from Jimmy Bogard (creator of MediatR and AutoMapper) announcing that these libraries are going commercial. And to be clear, I fully support that. Time is money, and supporting your family always comes first. BUTβ¦ In most of my projects, I donβt actually use everything MediatR offers. I usually just need a small part of it, the classic "send a request, get a response" pattern. So I thought: why not build a simple version myself? π Thatβs...