Тёмный

Unit Of Work Repository Pattern c# 

TechWebDots
Подписаться 4 тыс.
Просмотров 26 тыс.
50% 1

#unitofwork pattern in c# with very easy Code Example | asp.net mvc | entity framework | .net core
Steps are same in both framework.
unit of work generic repository pattern c# | design patterns c#
Suggested Videos: Please watch the last two session for better understanding before proceeding
1. Previous : Repository Pattern c# :
• Repository Pattern c#
2. Previous : Generic Repository Pattern c# :
• Generic Repository Pat...
3. SOLID Design Principles in C# | With very easy code examples
• SOLID Design Principle...
4.Dependency Injection C# | Design Pattern | ASP.NET MVC
• Dependency Injection C...
5.Dependency Injection C# | Design Pattern | ASP.NET CORE MVC
• Dependency Injection C...
6.Object Oriented Programming in C# | OOPS | For beginners
• Object Oriented Progra...
GitHub Repo:
github.com/TechWebDots/UnitOf...

Опубликовано:

 

21 июл 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 35   
@MichalJan
@MichalJan 3 года назад
Thank you for explaining Unit Of Work. It's not easy to find good explanation on RU-vid, so thanks for great work! Subscribed :)
@TechWebDots
@TechWebDots 3 года назад
Hi MJ, Thank you very much for taking time to give feedback ❤ & encourage me create more such videos. May I ask you for a favor. I want these videos to be helpful for as many people as possible. Please share where you think. Happy Coding and Good Luck TechWebDots!
@satepestage3599
@satepestage3599 3 месяца назад
Very helpful, thanks
@bharathip9558
@bharathip9558 10 месяцев назад
I enjoyed all of your videos. thank you sir
@TechWebDots
@TechWebDots 9 месяцев назад
Hi bharathip9558, Thank you very much for taking time to give feedback & encourage me create more such videos. If you like this videos, please click on the THUMBS UP 👍. May I ask you for a favor. I want these tutorials to be helpful for as many people as possible. Please share where this learning might be helpful. Happy Learnig, TechWebDots!
@mustapharabiuadeola3646
@mustapharabiuadeola3646 3 года назад
This is a life saving vidoe... Thanks a lot
@TechWebDots
@TechWebDots 3 года назад
Hi Mustapha, Thank you very much for taking time to give feedback ❤ & encourage me create more such videos. May I ask you for a favor. I want these videos to be helpful for as many people as possible. Happy Coding and Good Luck TechWebDots!
@bharatchauhan3242
@bharatchauhan3242 3 года назад
Thank you for good explanation in the video. Please make a video demonstrating how to use dependency injection as you referred in the last.
@TechWebDots
@TechWebDots 3 года назад
Hi Bharat, Please checkout the description for video of Dependency Injection in C# or The links of DI given below. 1.Dependency Injection C# | Design Pattern | ASP.NET MVC ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-dUYeFAoZcwI.html 2.Dependency Injection C# | Design Pattern | ASP.NET CORE MVC ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-qZRsIX4nm24.html And thank you very much for taking time to give feedback. Means a lot. Don't forget to Like 👍 & subscribe & encourage me create more such videos. Happy Coding and Good Luck TechWebDots!
@sanjayheralge758
@sanjayheralge758 2 года назад
Thank you for video. If possible can you please start series for data structure and algorithm using c#. Your way of explanation is very simple and it will be interesting to learn DSA from you.
@TechWebDots
@TechWebDots 2 года назад
Hi sanjay heralge, Thank you very much for taking time to give feedback. Please checkout my Graph Data Structure in C# Playlist Link: ru-vid.com/group/PLBEm2Vv2nD-MFxyeYuPgPGzkpYJv-nQGI I will upload more, thanks for your interest 💙. Don't forget to subscribe (if not yet done 🙂) & encourage me create more such videos. If you like these videos, please click on the THUMBS UP👍 button and share with others where this might be helpful. Happy Coding and Learning, Good Luck TechWebDots!
@gopimathi8137
@gopimathi8137 Год назад
Nice explanation
@TechWebDots
@TechWebDots Год назад
Hi Gopi Mathi, Thank you very much for taking time to give feedback. If you like these videos, please click on the THUMBS UP👍 button and share with others where this might be helpful. Happy Learning, Good Luck TechWebDots!
@thanhnguyenbk
@thanhnguyenbk 2 года назад
Thank you for explaining but I have a question: Do you have to create multiple Repository in the UnitOfWork class. I think that whether you should create the method GetRepository to return repository for entity like this: public IRepository GetRepository { return new Repository(); } Do you think about this.
@TechWebDots
@TechWebDots 2 года назад
Hi Ngo, Thank you very much for taking time to give feedback ❤ & encourage me create more such videos. [Answer to your question] : Its completely up to you what level of code refactoring, reusability and optimization you want to use, actually depends upon your project structure as well. The whole point, I tried to explain was "What is Unit of Work, how its works and how it is different from Normal Repository pattern". Your suggestion is absolutely right but I tried to make it super simple and easy to understand for all. Happy Coding and Good Luck TechWebDots!
@thanhnguyenbk
@thanhnguyenbk 2 года назад
@@TechWebDots thanks. Hope to see more videos from you.
@DaveRoman-mc4nn
@DaveRoman-mc4nn 2 года назад
Adding many repositories in the UnitOfWork class can increase memory consumption, because the more repository attributes you add, the more memory you use. Now imagine that in an application you only need one repository in one request and what about the others? A waste of memory.
@shafiqurrahman1870
@shafiqurrahman1870 3 года назад
Thank you very much. But I need to clear one thing that is you are using UnitofWork wow = new UnitofWork(); in the controller, why you are not using constuctor injection. Instead of using class we can use IUnitofWork. which one is better.
@TechWebDots
@TechWebDots 2 года назад
Hi Shafiqur, Thank you very much for taking time to give feedback ❤ & encourage me create more such videos. [Answer to your point] : There are many ways to implement in programming world. Its completely up to you, How you want to implement, actually depends upon your project structure as well. The whole point, I tried to explain was "What is Unit of Work, how its works and how it is different from Normal Repository pattern". Your suggestion is absolutely right but I tried to make it super simple and easy to understand for all. Happy Coding and Good Luck TechWebDots!
@pmro
@pmro Год назад
Hi, ;) Could You explain, should I use (and if how to implement Unit Of Work with Generic Repo when my repositories have different "crud" operations). For example I have in one repo: - method GetSomeObject(int id) -> that returns me an Object from Db by given Id. - method GetSomeObjectWithDetails(int id) -> that returns me an Object but with additional data (I'm using joining table for example) Other repo doesn't have such (second) method, what to do in that situation? I cannot use Generic Repo because I have different methods in every repo, there is only several which could be "the same". Thanks for help!
@TechWebDots
@TechWebDots Год назад
Hi PMRO, Software Design plays a very important role for any application either its of Unit of Work, Repository or Generic Repository. Its hard to understand the real problem in two lines but what I can suggest is, You can use the Generic one where you have common behaviour but If the behavour expectation is defferent then try to follow the Dependency Inversion Principle (DIP) and perform the required operation CRUD etc. You can find these videos in the TechWebDots channel easily but here is the quick links. SOLID Design Principles in C# | With very easy code examples ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-A5OD1gtaMm8.html Design Patterns in C# | Complete Playlist ru-vid.com/group/PLBEm2Vv2nD-Ppk8U_LaR8wXl47kgCI8Dl Hope you like our video. Team TechWebDots!
@sinaalinejad4161
@sinaalinejad4161 3 года назад
thank you very much but it was better to open all of the folders so that we can see what is in them
@TechWebDots
@TechWebDots 3 года назад
Hi SA, You can see the full structure of folders and the complete code on below URL. I make it open for everyone, nothing is hidden. github.com/TechWebDots/UnitOfWork.git & Thank you very much for taking time to give feedback ❤ & encourage me create more such videos. May I ask you for a favor. I want these videos to be helpful for as many people as possible. Please share where you think. Happy Coding and Good Luck TechWebDots!
@a7medmahdi931
@a7medmahdi931 2 года назад
thank you
@TechWebDots
@TechWebDots 2 года назад
Hi A7med Mahdi, Thank you very much for taking time to give feedback ❤. Don't forget to subscribe (if not yet done 🙂) & encourage me create more such videos. If you like these videos, please click on the THUMBS UP👍 button and share with others where this might be helpful. Happy Coding and Learning, Good Luck TechWebDots
@Riteshtandon23
@Riteshtandon23 Год назад
We can also make generic unit of work which will return a repository object.
@TechWebDots
@TechWebDots Год назад
Hi Ritesh Tondan, Thank you very much for taking time to give suggestion💙. Pure Generic Repository pattern is already there in the playlist. If you like these videos, please click on the THUMBS UP👍 button and share with others where this might be helpful. Happy Learning, 💙 Good Luck TechWebDots!
@Riteshtandon23
@Riteshtandon23 Год назад
@@TechWebDots Thank you :-)
@zerosandones7547
@zerosandones7547 3 года назад
what is IIS @5:25?
@TechWebDots
@TechWebDots 3 года назад
Internet Information Services (IIS, formerly Internet Information Server) is an extensible web server software created by Microsoft. It has been an integral part of the Windows. IIS is one of the most powerful web servers from Microsoft. Most commonly, IIS is used to host ASP.NET web applications and static websites. It can also be used as an FTP server, host WCF services, and be extended to host web applications built on other platforms such as PHP. There are built-in authentication options such as Basic, ASP.NET, and Windows auth. IIS has its own ASP.NET Process Engine to handle the ASP.NET request. So, when a request comes from client (browser) to server, IIS takes that request and process it and send the response back to clients. Worker process is the heart of ASP.NET Web Application which runs on IIS. Hope, till now it’s clear to you that what is the Web server and IIS is and what is the use. For more details- en.wikipedia.org/wiki/Internet_Information_Services Happy Coding and Good Luck TechWebDots!
@zerosandones7547
@zerosandones7547 3 года назад
any ado.net examples for this topic?
@TechWebDots
@TechWebDots 3 года назад
Hi ZeO, Thank you very much for taking time to give feedback. This means a lot. So far I have not created for ADO.NET but for sure in coming future. If you like these videos, please click on the THUMBS UP button below the video. Don't forget to subscribe & encourage me create more such videos. Happy Coding and Good Luck TechWebDots!
@zerosandones7547
@zerosandones7547 3 года назад
@@TechWebDots I'm still new to this, after learning repository pattern, I find it best to use it with unit of work right? I'm planning to use ado.net but most of the tutorials on the web is about entity framework...
@TechWebDots
@TechWebDots 3 года назад
@@zerosandones7547 Pure ADO.NET is legacy now a day because of advance versions of .Net (framework & core). If you are already maintaining transactions in efficient way in your app then you can skip this because I believe you have already seen in this current session, what kind of project structure changes it requires. But if you still want to apply unit of work in your space asap then below are the two articles that can give you some hints instantly: codereview.stackexchange.com/questions/144784/unit-of-work-uow-pattern-with-ado-net www.codeproject.com/Articles/709052/Unit-of-Work-Sample-Implementation-for-ADO-NET Happy Coding and Good Luck TechWebDots!
@zerosandones7547
@zerosandones7547 3 года назад
@@TechWebDots what do you mean by legacy? I keep hearing that word but I don't really know what "legacy code" is I am planning to create a new project, and I am already confident about my ADO.NET skills, since making stored procedures is easier for me. So is it okay if I don't use entity framework?
Далее
Generic Repository Pattern c#
17:35
Просмотров 18 тыс.
The Unit of Work Design Pattern Explained
12:37
Просмотров 21 тыс.
FABIANO SACRIFICES 2 ROOKS AND WINS IN 9 MOVES!
6:07
Просмотров 376 тыс.
Using Unit of Work Pattern
13:43
Просмотров 34 тыс.
Abstract Factory Pattern Made Simple in C#
25:04
Просмотров 2,4 тыс.