Using Ardalis Specifications with EF Core 8

  Рет қаралды 7,091

Ardalis

Ardalis

Күн бұрын

Пікірлер: 37
@ourvalleys
@ourvalleys 23 күн бұрын
just what's needed. nothing more - nothing less. thank you.
@Ardalis
@Ardalis 21 күн бұрын
Awesome, that's the goal!
@phyberoptyk5619
@phyberoptyk5619 9 ай бұрын
Been using your repositories and specifications in Production since beginning 2022. It's just so easy to implement! Thank you.
@Ardalis
@Ardalis 9 ай бұрын
You're very welcome! Glad they're working well for you. There are always some who say they won't work but I haven't run into any significant pain points in the many apps I'm using them in.
@phyberoptyk5619
@phyberoptyk5619 9 ай бұрын
@@Ardalis Our only pain point was temporal table specifications that aren't supported out of the box, but we were able to easily extend the library by adding our own.
@shorttravelvideos9649
@shorttravelvideos9649 6 ай бұрын
As expected from Ardalis, always substantial. Thank you.
@Ardalis
@Ardalis 6 ай бұрын
Thank you too!
@Dragonet17
@Dragonet17 8 ай бұрын
Greate job ! I think, we need more of your videos, how to use your libs in specific scenarios.
@Ardalis
@Ardalis 8 ай бұрын
More to come!
@frankbanini8884
@frankbanini8884 7 ай бұрын
Great video. Matured stuff. Steve will direct you to always do the right thing. Thank you Sir, I am grateful 🙏 .
@Ardalis
@Ardalis 7 ай бұрын
I appreciate that!
@krccmsitp2884
@krccmsitp2884 2 ай бұрын
Great stuff! 👍
@Ardalis
@Ardalis Ай бұрын
Thank you! Cheers!
@caseyspaulding
@caseyspaulding 5 ай бұрын
Thank you. Very helpful. Just learning about specifications.
@Ardalis
@Ardalis 5 ай бұрын
Glad it was helpful!
@cleitoncarlospereira2006
@cleitoncarlospereira2006 8 ай бұрын
Hello everything is fine? I am using the Specification package in my projects and it is working perfectly. I would like to know if I can work with joining specifications with the operators And, Not, Or. Thank you.
@Ardalis
@Ardalis 7 ай бұрын
No, that's not supported and not recommended (but it is frequently requested). See: github.com/ardalis/Specification/issues/335
@jerryjeremy4038
@jerryjeremy4038 8 ай бұрын
Can you also implement bulk Crud operations? Thanks
@Ardalis
@Ardalis 7 ай бұрын
yes but that wouldn't warrant specifications. EF supports these as does raw SQL...
@margosdesarian
@margosdesarian 8 ай бұрын
Super
@Ardalis
@Ardalis 7 ай бұрын
Thanks
@ariefyousif521
@ariefyousif521 9 ай бұрын
Hello, I was wondering if you're familiar with Odata which is similar to graphql; why would one choose to go with this specification pattern instead of something like Odata?
@Ardalis
@Ardalis 9 ай бұрын
Yes, OData is quite different from specifications, conceptually. OData is about exposing your database over HTTP. In that way you're correct, it's like GraphQL. In either case, it lets the consumer of the web service (via OData/GraphQL) create whatever queries they want (within the supported set) and the server basically just executes the queries it is sent. Using specifications implies that you're going to have a discrete set of operations that your application uses, and you want to treat them as part of your business logic / domain model. Thus, you don't let *even your own application* (much less random clients on the web) generate custom queries, because you want to ensure the queries are correct and that they are reused where appropriate (you don't want two different versions of a query that should logically return the same results, for example). Hope that helps.
@dungha6285
@dungha6285 4 ай бұрын
Hello sir, i am trying to approach a different way to relational database which means i want to apply inner join for no sql instead of relational database? Because relational database will be low performance when there are a lot of data. Thank you and best regards
@Ardalis
@Ardalis 4 ай бұрын
Good luck but I'm not sure this video is relevant to your needs. If you are using a relational database and your joins are slow because of too much data, one option is to denormalize the data, which is basically the technique a no-sql database would use, too.
@PhantasyAI0
@PhantasyAI0 8 ай бұрын
does the Ardalis spec package cause any performance overhead?
@Ardalis
@Ardalis 8 ай бұрын
Not compared to just using EF6/EF Core, that I'm aware of. And the built-in caching features obviously dramatically improve performance if you can and do use caching.
@DucThangLe-n6q
@DucThangLe-n6q 9 ай бұрын
Hi, I am using your clean architecture sample ! Seem, project Specification.EntityFrameworkCore just implemented Repository pattern. You SaveChangesAsync affter Func CUD called ( _dbContext.Set().Add/Remove/Update). But in Repository pattern I referenced, it implements IUnitOfWork. Why u use repository pattern without IUnitOfWork in your clean achitecture sample? If I use IUnitOfWork, what is need I Do? Looking forward to your response, Thanks and have a nice day !!!
@Ardalis
@Ardalis 8 ай бұрын
The repository sample implementation in Ardalis.Specification is optimized for simple Web APIs which typically only modify a single aggregate in a given CUD request. Thus, it simply saves changes implicitly any time you call one of its Add/Update/Delete methods (instead of using or exposing a separate Unit of Work). It's simple. If it's *too* simple and you need a separate unit of work, you can use your own abstraction. The simplest approach would be to just expose SaveChanges on your repository abstraction and do NOT automatically call savechanges in your CUD methods. But this is only a very simple version of Unit of Work since it's possible for you to have separate repositories working on separate aggregates and then when you call SaveChanges on one of them, the other's modified entities will also be persisted (which may not be what you wanted). So an even more complex approach is to have a separate UnitOfWork type that manages all of your persistence. Often when using this approach you need to request your repository instances from the UnitOfWork, and then when you're ready you Commit on the UnitOfWork and any repositories that came from it are likewise committed (but those from separate Units of Work are not). Hope that helps.
@yurimelo3404
@yurimelo3404 8 ай бұрын
Does this nuget work with MongoDB?
@Ardalis
@Ardalis 8 ай бұрын
The base package yes but there’s not a translation package for MongoDb (yet).
@pilotboba
@pilotboba 9 ай бұрын
googlebing? No, I duck that. :)
@Ardalis
@Ardalis 9 ай бұрын
DDG also works :)
@winstochurgle9133
@winstochurgle9133 8 ай бұрын
Where can i use .AsNoTracking() method using your library? I mean i keep getting error about tracking when trying to update an entity that i have already get. var existCategory = await _categoryRepository.GetByIdAsync(request.Id, cancellationToken); Guard.Against.NotFound(request.Id.ToString(), existCategory, nameof(existCategory.Id)); var categoryToUpdate = _mapper.Map(request); await _categoryRepository.UpdateAsync(categoryToUpdate); - here
@Ardalis
@Ardalis 7 ай бұрын
Your error is in your mapping line - you're getting a new entity not updating the one you fetched. Update the one you fetched instead. Also to answer your question, you can use AsNoTracking within your specification, but it won't fix your problem. specification.ardalis.com/features/asnotracking.html
@winstochurgle9133
@winstochurgle9133 7 ай бұрын
@@Ardalis i see. Thank you big time!
5 Rules For DTOs
17:56
Ardalis
Рет қаралды 45 М.
Exceptions Are Extremely Expensive… Do This Instead
17:15
Milan Jovanović
Рет қаралды 47 М.
Миллионер | 3 - серия
36:09
Million Show
Рет қаралды 2,1 МЛН
Мама у нас строгая
00:20
VAVAN
Рет қаралды 11 МЛН
Custom Specifications with EF Core
5:33
Ardalis
Рет қаралды 4,3 М.
The Only .NET Scheduler You Should Be Using!
16:38
Nick Chapsas
Рет қаралды 55 М.
.NET Redis client has a problem and affects globally .NET apps
19:13
Daniel Tila - EnterpriseDotNet
Рет қаралды 3,8 М.
How To Use The Specification Design Pattern With EF Core 6
19:13
Milan Jovanović
Рет қаралды 40 М.
Fluent Validation in MediatR with Results
7:18
Ardalis
Рет қаралды 6 М.
How to Build an Outbox with EF Core Interceptors
14:36
Milan Jovanović
Рет қаралды 13 М.
Deliver Better PowerPoint Presentations
9:03
Ardalis
Рет қаралды 1,6 М.
Build Your Own Option Type in C# and Use It Like a Pro
18:31
Zoran Horvat
Рет қаралды 15 М.
What’s the Result Type Everyone Is Using in .NET?
14:47
Nick Chapsas
Рет қаралды 113 М.
Миллионер | 3 - серия
36:09
Million Show
Рет қаралды 2,1 МЛН