\n\n","recentPosts":[{"id":8699980,"title":"You Don’t Need MediatR? I Built My Own 🚀","slug":"mediatr-is-going-commercial-here-s-what-i-m-doing-instead","status":"published","readingTime":1,"campaignCompletedAt":"2025-04-15T15:06:29.000Z","publishedAt":"2025-04-15T15:06:29.000Z","orderByDate":"2025-04-15T15:06:29.000Z","timeAgo":"10 days","thumbnailUrl":"https://functions-js.convertkit.com/playbutton?play=%23324C85&accent=%23ffffff&thumbnailof=https%3A%2F%2Fyoutu.be%2Fk62-sq35no8&width=480&height=270&fit=contain","thumbnailAlt":"video preview","path":"posts/mediatr-is-going-commercial-here-s-what-i-m-doing-instead","url":"https://dotnet8.patrickgod.com/posts/mediatr-is-going-commercial-here-s-what-i-m-doing-instead","isPaid":null,"introContent":"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...","campaignId":19018091,"publicationId":15578937,"metaDescription":""},{"id":8565536,"title":"A Cleaner Way to Build .NET Web APIs (No Controllers Needed!) 🤯","slug":"a-cleaner-way-to-build-net-web-apis-no-controllers-needed","status":"published","readingTime":1,"campaignCompletedAt":"2025-04-08T15:06:09.000Z","publishedAt":"2025-04-08T15:06:09.000Z","orderByDate":"2025-04-08T15:06:09.000Z","timeAgo":"17 days","thumbnailUrl":"https://functions-js.convertkit.com/playbutton?play=%23324C85&accent=%23ffffff&thumbnailof=https%3A%2F%2Fyoutu.be%2Fox-3Lta4jIM&width=480&height=270&fit=contain","thumbnailAlt":"video preview","path":"posts/a-cleaner-way-to-build-net-web-apis-no-controllers-needed","url":"https://dotnet8.patrickgod.com/posts/a-cleaner-way-to-build-net-web-apis-no-controllers-needed","isPaid":null,"introContent":"Hey Reader, In my last video, I showed you how to build a CRUD app using Vertical Slice Architecture and controllers in .NET 9. But… What if you could do the same thing - cleaner, simpler, and without all that controller clutter? 👉 That’s exactly what I show you in my brand-new video: In this one, you’ll learn how to: Use Minimal APIs instead of controllers Keep your Program.cs neat and tidy Stay fully organized with the Vertical Slice Architecture Work with Carter, a super helpful library...","campaignId":18858050,"publicationId":15417326,"metaDescription":""},{"id":8565430,"title":"Build a CRUD App with Vertical Slice Architecture in .NET 9 🚀","slug":"you-re-building-crud-apps-the-hard-way-try-this-instead","status":"published","readingTime":1,"campaignCompletedAt":"2025-04-01T15:05:25.000Z","publishedAt":"2025-04-01T15:05:25.000Z","orderByDate":"2025-04-01T15:05:25.000Z","timeAgo":"24 days","thumbnailUrl":"https://functions-js.convertkit.com/playbutton?play=%23324C85&accent=%23ffffff&thumbnailof=https%3A%2F%2Fyoutu.be%2Fdnvi0B76ekg&width=480&height=270&fit=contain","thumbnailAlt":"video preview","path":"posts/you-re-building-crud-apps-the-hard-way-try-this-instead","url":"https://dotnet8.patrickgod.com/posts/you-re-building-crud-apps-the-hard-way-try-this-instead","isPaid":null,"introContent":"Hey Reader, If you’ve ever built a simple CRUD app with a layered architecture… you might be making things harder than they need to be. In my newest YouTube tutorial, I show you how to build a scalable CRUD app using something super clean and refreshing: 👉 Vertical Slice Architecture in .NET 9 We’ll build a full Video Game API, step-by-step, with: .NET 9 Web API + Entity Framework Core Code-first migrations Controllers (yep, still using those!) The Mediator pattern for cleaner code And, of...","campaignId":18857921,"publicationId":15417197,"metaDescription":""}],"newsletter":{"formId":3389294,"productId":null,"productUrl":null,"featuredPostId":null,"subscribersOnly":false},"isPaidSubscriber":false,"isSubscriber":false,"originUrl":"https://dotnet8.patrickgod.com/posts/blazor-s-new-web-app-template-deepen-your-repository-pattern-knowledge","creatorProfileName":"Patrick God","creatorProfileId":945733}
Hey Reader,
The recent release of .NET 8's RC1 brought us an exciting Blazor Web App Template that combines both Blazor Server and WebAssembly in a single project. In my latest video, I dive into this template, highlighting the new render modes of Blazor in .NET 8.
Additionally, I wanted to share an intriguing Q&A from our .NET Web Academy Community this week about enhancing repositories as applications grow. Paolo asked:
"Hi Patrick, sometimes it is necessary to work on several Domain Entities at the same time and the single-entity CRUD offered by Repositories is not sufficient. Thinking of combining in a 2nd level Repository, which uses single-entity repositories is sometimes not possible and often creates a performance decay. What is your suggestion?"
My response:
"Hi Paolo,
Thank you for your insightful question. As our applications grow, it’s essential to address architectural concerns to balance flexibility, maintainability, and performance. Let’s dive deeper into the solutions with a mix of simple theoretical insight and code examples tailored to our .NET Web Academy’s project.
Aggregate Roots:
Think of an Aggregate Root as a main item that groups related things together. By working with this main item, we can easily manage the related items without messing things up.
Example: In our TimeTracker, a Project can be seen as the main item that has linked TimeEntry and ProjectDetails. So, if we want to make changes to a TimeEntry for a project, we go through the Project.
Specification Pattern:
This is a way to set rules for fetching specific items from our data. It’s super useful when we have a lot of rules!
Example: Instead of multiple methods to get data, we use rules. Like one that fetches all time entries for a project.
UnitOfWork Pattern:
It’s like a safety net. When we have multiple changes to save, it ensures all changes are saved correctly or none at all.
Example: If we’re updating a Project and its TimeEntry, this ensures both updates are done right.
Performance Tips:
As our app grows, it’s important to fetch data quickly. There are ways to do this effectively.
Example: Using Entity Framework, we can fetch a Project and its TimeEntries together, which is faster.
Custom Repositories:
Sometimes, we need special methods to get or update our data.
Example: A method that gets a Project, its TimeEntries, and ProjectDetails all together.
In short, as we handle more data, we might need to mix and match different techniques to make things easier and faster. Your question helps us all think deeper about these challenges."
📩 Have a burning question or a topic on your mind? Simply hit 'reply' and send it my way. I genuinely appreciate your feedback and ensure I read every message.
Until next time, happy 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, 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...
Hey Reader, In my last video, I showed you how to build a CRUD app using Vertical Slice Architecture and controllers in .NET 9. But… What if you could do the same thing - cleaner, simpler, and without all that controller clutter? 👉 That’s exactly what I show you in my brand-new video: In this one, you’ll learn how to: Use Minimal APIs instead of controllers Keep your Program.cs neat and tidy Stay fully organized with the Vertical Slice Architecture Work with Carter, a super helpful library...
Hey Reader, If you’ve ever built a simple CRUD app with a layered architecture… you might be making things harder than they need to be. In my newest YouTube tutorial, I show you how to build a scalable CRUD app using something super clean and refreshing: 👉 Vertical Slice Architecture in .NET 9 We’ll build a full Video Game API, step-by-step, with: .NET 9 Web API + Entity Framework Core Code-first migrations Controllers (yep, still using those!) The Mediator pattern for cleaner code And, of...