Specification Pattern in a .NET 8 Web API 🚀 Improving Your Repositories!

preview_player
Показать описание

In this video, we dive deep into implementing the Specification Pattern in a .NET 8 Web API. Learn how this design pattern can enhance your repositories, making your code cleaner, more efficient, and easier to manage. Perfect for anyone looking to level up their .NET web development skills!

📚 My .NET & Blazor Udemy Courses:
🎉 Grab a massive discount by using the code "DOTNET9".

📑 Table of Contents:
00:00 Specification Pattern in a .NET 8 Web API 🚀
00:47 Web API Project Overview
02:20 What is the Specification Pattern?
04:21 Implement Specifications
10:03 Create & use a new Specification
14:56 Test our first Specification
15:29 Add Includes & OrderBy to a Specification
19:27 Create another Specification

🏷️ #DotNet #DotNet8 #WebAPI
Рекомендации по теме
Комментарии
Автор

Overall good approach, the one thing I don't like here is that we end up with many many specification classes. I think we have to make it more "composition over inheritance"

nikolayrogchev
Автор

“I will not include everything here now so you don’t get scared”… yeah that ship had sailed lol

Viking
Автор

*Superb!, I appreciate the effort you put into making these videos*

hanomedia
Автор

Hi Patrick, great stuff. I am really glad I came across your channel, I love the way you teach, very simple and clear. I just have two questions: So if I understand correctly now, basically instead of having a monster repository class you will have tons of smaller classes implementing each and every possible permutation of the query? And secondly, my old brain always likes to re-use code, so would it be an anti-pattern to parameterize the specifications with the filter and include and order by so you can get the filters etc. from a view passing into the controller? Any thoughts on this, or are there other patterns that could solve that problem better. Thanks again for a really good tutorial, looking forward going through all your stuff, and really interested in everything .net 8.

FrankTank
Автор

Great stuff! I always appreciate your videos… Just curious - is there a reason why you didn’t turn the SpecificationQueryBuilder into an extension method (with just an extra ‘this’ keyword)? Wouldn’t that increase the readability a bit more? You would be able to write exp)

tje
Автор

Hi, can you please make a video on blazor with google auth deployed to azure? I know you have one already but that is only working locally.

honestcommenter
Автор

I just woke up to this, so sweet stuff. Patrick isn’t this the query object pattern described by Fowler in PoEE?

kasozivincent
Автор

This looks like CQRS with additional steps.

MrMithgroth
Автор

Thanks for the videos but I think with this one we are entering into the over engineering territory .

zimcoder
Автор

I didn't understand what's the benefit

MohammadKomaei
Автор

Patrick, great video indeed this is! Now, how could we pass the where clause value ("RPG") to the controller (also the includes and ordeby), so I want to get this and not a static specification class;
GET /api/Game/{genre}

augustusdevree
Автор

Hi Patrick, I was wondering how will you handle the ThenInclude in the expression?

alecmatias
Автор

Thanks, bro what if I need more than one condition in the where clause, for example, I need Employee where the name is "Patrick" and IsPresent. How to implement that here

mostafasalaheldin
Автор

Show later how to combine multiple specifications

magashkinson
Автор

Hey. You create instance of every Specification for each API request and these instances don't take parameters.
Is it better to make them static or create them once at the beginning?

adam-xtte
Автор

object' does not contain a definition for 'Aggregate' and no accessible extension method 'Aggregate' accepting a first argument of type 'object' could be found (are you missing a using directive or an assembly reference? how to remove this error

SahilSankla
welcome to shbcf.ru