Using Unit of Work Pattern

  Рет қаралды 36,522

Study Mash

Study Mash

Күн бұрын

Пікірлер: 45
@PrinceKumar-eb8hd
@PrinceKumar-eb8hd 3 жыл бұрын
I don't have words to say, even a person will spend lakhs of rupees but won't get this much of understanding, I watched all video of this series more than 3 times & will watch more no of times, Really by watching again & again video, I understand the concept very well. Thank You so much @study Mash..lots of Respect for you!
@StudyMash
@StudyMash 3 жыл бұрын
Thanks Prince, hope you are doing well in your new job.
@codeschool3964
@codeschool3964 2 жыл бұрын
I watching lot of videos and trying to understand UOW. This is the shortest and the best one. Now I understand what uow is. Thanks a lot. Keep up!
@StudyMash
@StudyMash 2 жыл бұрын
Glad to hear that buddy
@javierfelixalonsolopez3946
@javierfelixalonsolopez3946 3 жыл бұрын
Best way to explain it. THANKS! you help me understand the last part with the BEGIN TRAN and COMMIT TRAN analogy!! Excellent work! Im subscribing!
@sandeepreddy475
@sandeepreddy475 2 жыл бұрын
After a lot of research, Finally here is someone who can throw away my confusion. Thank you man..!
@StudyMash
@StudyMash 2 жыл бұрын
Glad to hear that Sandeep
@Apprenticer
@Apprenticer 2 жыл бұрын
After 1 minute of watching the video I added you to my favs. Subscribed. I really like your way of explaining things. and topics you teach!!! I wish your examples were in java and jpa.
@flywheel56
@flywheel56 4 жыл бұрын
Enlightening tutorial on an elegant pattern.
@samerelsahih
@samerelsahih 2 жыл бұрын
Wish I could like your videos multiple times over :) I've been a developer for a decade and still learn a lot from your videos.
@StudyMash
@StudyMash 2 жыл бұрын
Glad to hear that Sam
@matthayden1979
@matthayden1979 Жыл бұрын
I couldn't agree with you more!
@harrylyod3402
@harrylyod3402 4 жыл бұрын
Thank you for the new video been waiting for a while.
@nileshprajapati119
@nileshprajapati119 4 жыл бұрын
Nice and easy to understand content for beginner !!
@gajendrasalunkhe5750
@gajendrasalunkhe5750 3 жыл бұрын
Thanks a lot. Very well explained. Saved my day.
@tmmuttathara
@tmmuttathara 3 жыл бұрын
very explanative. understood many things i left out.
@nelsonthekinger
@nelsonthekinger 3 жыл бұрын
Beautiful Engineering 👌 Well done
@rohitpawar8710
@rohitpawar8710 3 жыл бұрын
nice explaination
@techrelated2417
@techrelated2417 3 жыл бұрын
awsome explaination!! Thanks
@joeycopperson
@joeycopperson 3 жыл бұрын
Thanks. Very good explanation :)
@NickEnchev
@NickEnchev 3 жыл бұрын
Excellent video, thanks!
@nagendrakumar4983
@nagendrakumar4983 3 жыл бұрын
It was pretty clear. Thanks
@nelsonthekinger
@nelsonthekinger 3 жыл бұрын
Should a Unit of work have all the repositories? Or should only have the repositories used on the endpoint? Or should only have one repository ? (doesn't seem to make sense)
@DaveRoman-mc4nn
@DaveRoman-mc4nn 2 жыл бұрын
Should not have all repositories. Use a generic repository and add it as a property in the IUnitOfWork interface.
@avinashg2008
@avinashg2008 3 жыл бұрын
wat a video. amazing. thanks one query: does it mean that if we are using EF core then there is no need to implement uow, repository patterns explicitly?
@goodoleme747
@goodoleme747 3 жыл бұрын
Why didn’t you inject CityRepository into your UnitOfWork class? I don’t think newing up the repository is a good idea because that also violates dependency inversion.
@mi5956
@mi5956 3 жыл бұрын
what if we have store procedures, do we still need UOW?, because most of SPs are complete script for saving changes and everything we just need to call it.
@ahmadbaderkhan598
@ahmadbaderkhan598 3 жыл бұрын
no you don't need it . don't write more code if you don't need to . these patterns solve a problem basically . what you're describing is a non problem since stored procedures you can do multiple stuff at once . so i would just have the repo calling it
@nasmob5656
@nasmob5656 2 жыл бұрын
Legend !
@cmnckang8291
@cmnckang8291 2 жыл бұрын
this is amazing
@khaledsaleh7798
@khaledsaleh7798 3 жыл бұрын
what about TransactionScope() ? is it an alternative to unit of work?
@adamschneider868
@adamschneider868 2 жыл бұрын
Thats ACID and just ensures that you dont store incomplete data in the database.
@eswar338
@eswar338 4 жыл бұрын
Can you use a generic repository instead of using multiple Repositories
@StudyMash
@StudyMash 4 жыл бұрын
Yes I will use generic one for the basic functionality in upcoming lessons
@eswar338
@eswar338 4 жыл бұрын
@@StudyMash Thanks. I am expecting CRUD operations using generic Reposit with UOW
@sajad5644
@sajad5644 4 жыл бұрын
hi , i have some sort of question , putting all repositories in a single uow class is normal way ? or we should create multiple uow depend amount of relationship between repositories ?
@StudyMash
@StudyMash 4 жыл бұрын
Splitting UOW is developer's own choice, but we should always make sure to put all relational repo in single UOW, others you will end up facing transactions issue while saving the data of relational entities.
@sajad5644
@sajad5644 4 жыл бұрын
​@@StudyMash thank you alot, In such a way application will be slower , isn't it ? for example we have more than 10 or 20 repositories and so for a single request we are creating instance of 10(or 20) repository but we are using just two of them, yes every things have pros and cons ,but how much it can reduce speed
@StudyMash
@StudyMash 4 жыл бұрын
@@sajad5644 If you look at the UnitOfWork.cs file, you can see different repositories are accessible using properties, I have not initialized it in constructor. So the answer to your question is : No it will not be slower, because it will not create an instance of repository until you will use that somewhere in controller.
@sajad5644
@sajad5644 4 жыл бұрын
@@StudyMash I realized ,tanx so much, please if you can ,in one of your future videos teach us how we should use usermanager in such a way(uow) , because as i know usermanager save transaction automaticly (i know about userStore and how to pass dbcontext instance to it but we(me and i think other guies) are not familiar with uow when using usermanager , It can be very helpful if u do that(for example what is required for creating instance of usermanager and so on..) tanx tanx tanx
@DaveRoman-mc4nn
@DaveRoman-mc4nn 2 жыл бұрын
@@StudyMash That's a good approach, but even for each property, you're reserving memory for each repository attribute (this makes the UnitOfWork instance heavy). That's a waste of memory if you only want to use two repositories in one request.
@rishikashnia1242
@rishikashnia1242 3 жыл бұрын
Wrong implementation. You breached the "D" of SOLID pattern by initializing the repository manually inside UnitOfWork. How would you MOCK the UOW in tests as it depends on concrete implementation of repository, Shouldn't it depends on abstraction (i.e. interface of repository) and dependency (repository) should be injected at run time.
@StudyMash
@StudyMash 3 жыл бұрын
Good question, I like it. No, its not wrong, we are already injecting UOW at runtime in controller and your are free to create your own concrete mock UOW and your own version of concrete repo because IUnitofWork is not depend on concrete type. So you can have own repo and uow that implement IUnitOfWork and IRepository. Feel free to let me know if you still have any question.
@mahmoodamer2156
@mahmoodamer2156 3 жыл бұрын
can you give us a simple practical example sir
@sivasagarjagga6445
@sivasagarjagga6445 3 жыл бұрын
not clear and confusing..
Why to use DTO (Data Transfer Objects)
11:02
Study Mash
Рет қаралды 33 М.
Using Repository Pattern
14:10
Study Mash
Рет қаралды 11 М.
BAYGUYSTAN | 1 СЕРИЯ | bayGUYS
36:55
bayGUYS
Рет қаралды 1,9 МЛН
My scorpion was taken away from me 😢
00:55
TyphoonFast 5
Рет қаралды 2,7 МЛН
Unit of Work Pattern in Unity
11:51
Infallible Code
Рет қаралды 49 М.
The Unit of Work Design Pattern Explained
12:37
ArjanCodes
Рет қаралды 26 М.
Unit of Work in ASP.NET Core
14:57
Raw Coding
Рет қаралды 21 М.
Unit of Work (C#) - PATTERNS OF ENTERPRISE ARCHITECTURE
20:42
SingletonSean
Рет қаралды 10 М.
Don't Use AutoMapper in C#! Do THIS Instead!
16:17
Codewrinkles
Рет қаралды 71 М.
Deep Dive Into the Repository Design Pattern in Python
11:56
ArjanCodes
Рет қаралды 81 М.
Why I Use The Unit of Work Pattern With EF Core | Clean Architecture
11:34
Event-Driven Architecture (EDA) vs Request/Response (RR)
12:00
Confluent
Рет қаралды 179 М.
BAYGUYSTAN | 1 СЕРИЯ | bayGUYS
36:55
bayGUYS
Рет қаралды 1,9 МЛН