Aokiri ๐ธ
Confusion about Repository Pattern and Unit of Work.
I mainly do it to have cleaner code. Because with the Repository Pattern, even though it has the advantage of decoupling components, in the long run, I'll end up adding about 10 different repositories and having to apply each of them individually.
On the other hand, with UnitOfWork, at least I can implement them all within itself and work with it. I know it has the disadvantage that, in the long run, one controller will have things it shouldn't... but at least the advantage is that the code feels cleaner. I'm not sure if this will cause me problems in the future, though...
19 replies
Confusion about Repository Pattern and Unit of Work.
Well, I think I'll continue learning these kinds of things in a general sense, at least to understand them... even if I don't end up using them.
Thank you very much for the response, really ^^
19 replies
Confusion about Repository Pattern and Unit of Work.
Oh, ok. Now I understand. Let me know something about the Unit of Work: how does it exactly works? I did this implementation:
Just passed the context and generated a new CategoryRepository object with the context as well.
Also implemented a Save() method (to save changes to the db)
19 replies