Step by Step - Repository Pattern and Unit of Work with Asp.Net Core 5

  Рет қаралды 62,202

Mohamad Lawand

Mohamad Lawand

Күн бұрын

Пікірлер: 75
@GGanzolo
@GGanzolo Жыл бұрын
The best video on the subject that I've seen in KZbin. Thank you very much!
@MohamadLawand
@MohamadLawand Жыл бұрын
Thank you it’s appreciated
@a.r.kengilish4589
@a.r.kengilish4589 2 жыл бұрын
God's blessing will upon on you sir. Thank you so much.
@khwajanamatullahseddiqy6999
@khwajanamatullahseddiqy6999 Жыл бұрын
Excellent and useful video step by step. Thank you Mr. Mohammad Lawand.
@josbex1684
@josbex1684 3 жыл бұрын
Muchas gracias mister Mohamed, gran contenido.... saludos de los andes peruanos
@2005Azm
@2005Azm 2 жыл бұрын
Thank you for the teaching!!
@mahfoudbouabdallah6286
@mahfoudbouabdallah6286 2 жыл бұрын
Hello Mohamad first of all thank you very much for your great tutorials you make. I am hoping you add automapper to this project. Big thanks from Algeria 🇩🇿
@ammarmahmoud4643
@ammarmahmoud4643 2 жыл бұрын
Thank U very much Mohamed
@Ranjeetsingh-bw4im
@Ranjeetsingh-bw4im 3 жыл бұрын
Hey Mohammed, thanks for the video, I like your way of teaching, can you make some videos for multithreading, async/await, please?
@HelloWorld-th9vb
@HelloWorld-th9vb 2 жыл бұрын
Thank you for sharing your knowledge 🙏
@eser-sahin
@eser-sahin 3 жыл бұрын
Many thanks for your efforts. The content is very clean as always. God bless you.
@an.truong
@an.truong Жыл бұрын
Excellent. Thank you so much
@VongsiLoryongpao
@VongsiLoryongpao 3 жыл бұрын
Thanks for sharing, just searching for it this morning :)
@farzaibsheikh9764
@farzaibsheikh9764 2 жыл бұрын
why did you add your dbContext in generic repo while you're directly hitting DbSet ??
@yousseftayek6031
@yousseftayek6031 3 жыл бұрын
Thank you very much sir, it's really awesome.
@NG-tn8cn
@NG-tn8cn 2 жыл бұрын
Thanks a lot for this video, it's all clear !!!
@UnpluggedPerformance
@UnpluggedPerformance 2 жыл бұрын
thanks bro for all the effort, love it
@nimanikoonazar1541
@nimanikoonazar1541 2 жыл бұрын
thanks mohammad greate course
@at3963
@at3963 3 жыл бұрын
Amazing work, I am subscribed to your channel now
@Chris-ll5fv
@Chris-ll5fv 3 жыл бұрын
thanks for the video. Is it needed to do add and delete async in the generic repository? I thought just the SaveChangesAsync is an async operation. With Add and Delete you are only changing the object in memory or not ?
@wikisurfer9032
@wikisurfer9032 2 жыл бұрын
Amazing video, helped a lot . Kudos
@timb00
@timb00 2 жыл бұрын
actually a great video which helped me understand my colleagues code :D thanks!
@1984rebwar
@1984rebwar 2 жыл бұрын
thank you Mohamad for this amazing tutorial, when you create a DbSet property you set this as a virtual what's benefits of declaring as a Virtual vs not Virtual, and when we can inheritance from IGenericRepository in UserRepository why do we need to create a class for GenericRepository ? thank you again
@husseinshukre3828
@husseinshukre3828 3 жыл бұрын
Great content and well made video, keep the good effort 👌👌
@AltP
@AltP 3 ай бұрын
Very impressive presentation on Repository Pattern and Unit of Work. I am having problems accessing your website. I am also not able to find the repository of this demo app on your GitHub account. Is it still available?
@echir4788
@echir4788 2 жыл бұрын
Thanks for this video sir, may I ask if what is the difference between repository pattern and service layer, because there seems to be similarity and I want to know what really is the difference. Thank you so much.
@stunna4498
@stunna4498 2 жыл бұрын
the service layer is where you gonna do your business logic then you call the repository to actually commit those changes you did in the business logic
@jamkas6954
@jamkas6954 3 жыл бұрын
هل ممكن بعض المحاضرات بالعربي نفتقد في العالم العربي للمحاضرات المتقدمة باسلوبك الشيق
@ashwanisingh3049
@ashwanisingh3049 3 жыл бұрын
Awesome 👍
@chyldstudios
@chyldstudios 3 жыл бұрын
Comprehensive!
@zanudas3877
@zanudas3877 2 жыл бұрын
thx for video
@hazemkerret2772
@hazemkerret2772 3 жыл бұрын
thanks a lot. would you please share with us, how to implement search functionality with multi parameters like date from to, userName, Id, ... etc. I search a lot but most of the video explain only search functionality without parameters input..! appreciate your efforts. Thanks
@Ka8eeM
@Ka8eeM 3 жыл бұрын
Did you find a direct way? please, if you did let me know
@UberEverywhereSKRT
@UberEverywhereSKRT 2 жыл бұрын
quick question my brother, what is the point of overriding the generic methods ? I thought we should only add methods that are unique to the the repo, and use generic methods in general
@olegalekos2181
@olegalekos2181 2 жыл бұрын
Exactly what i was thinking. Seems like a bad example!
@olegalekos2181
@olegalekos2181 2 жыл бұрын
Why do you have the generic repository if you are implementing all the methods inside the specific repository ?
@oldboy1900
@oldboy1900 2 жыл бұрын
Thank you so much
@WhipTeslaModel3
@WhipTeslaModel3 2 жыл бұрын
Genius
@rikudouensof
@rikudouensof Жыл бұрын
Thanks a lot, I am revisiting this video because i want cut time in a private project. I created a project with much more Tables. Some tables with their primaryKey not on same datatype, I do not have to implement the unit of work in the Specific Repository, and did something funny that works. public class GenericRepository : IGenericRepository where T : class K is now the type of the primary Key. of cause not all activity there is a Task some are Syncronious
@jorysoft1436
@jorysoft1436 2 жыл бұрын
واضح ان حضرتك من اصل عربى
@jesperkped
@jesperkped 2 жыл бұрын
I am confused on why you would still make your application depending on EntityFramework - when you are trying to decouple the data persistence layer from the application by using the repository pattern. The way you do - you do not really have the benefits you talk about in the start. You do not have separation of concerns. As you add EntityFramework as a service then all the functions are available to the programmer - this is not the right way to do it. The DbContext should only be known by the implementation of the database abstraction layer and not by the application itself.
@olegalekos2181
@olegalekos2181 2 жыл бұрын
Looks like a bad example, also the generic repository has no value at al with this example.
@SHUJA837
@SHUJA837 3 жыл бұрын
Hello Mohamad, thank you for this great job. I have a question let assume a simple model: Category(id, designation), SubCategory(id, cat_id, designation), Item(id, subcat_id, designation), order(id, item_id,price,qty). I m wondering if I need add all these entities in the unitofwork. If I understood well the UOW is just to send the changes to the database. Should I add all the repositories of all these entities(Category,SubCategory,Item) in the UOW? because I assume the user will fill them only once . Thanks
@stunna4498
@stunna4498 2 жыл бұрын
what if you wanna use transaction scope from entity framework? suposse you have a service that has multiple save changes and you need those ids to continue the operations. After you done everything you would want to commit everything and if something happened everything rollesback. Would you create a new method on IUnitService to start the transaction and then another method to commit those transactions?
@ibrahimhasaneen9276
@ibrahimhasaneen9276 3 жыл бұрын
hello mohammed , thank you for this great content , But I have question I see people create new solution and put Core and Repository as classLib and api in separate webApi not Folders in webApi project which way is better do you thnk?
@MohamadLawand
@MohamadLawand 3 жыл бұрын
Hello Ibrahim, It's used to organise your code, as its going to allow you to extend and build new functionality easier when you approach it this way. Thank you for your support
@benderios
@benderios 3 жыл бұрын
the first one is better, if you are developing big application
@dsjamg7806
@dsjamg7806 2 жыл бұрын
Hello, whats happen when i like add new Table, i should create the same number of class? Thanks
@pubg-gamer2188
@pubg-gamer2188 3 жыл бұрын
Hi Mohammed, The Repository pattern web api with MongoDB is good to have? What you think?
@gopalchudal1717
@gopalchudal1717 2 жыл бұрын
nice video, how to use storeprocedure in repository pattern.
@SharjeelRasheed
@SharjeelRasheed 11 ай бұрын
Nice name
@NG-tn8cn
@NG-tn8cn 2 жыл бұрын
as for the DisposeAsync method inside the uintofwork class, how can I call it in case of asynchronous call?
@orlandojoaobita7876
@orlandojoaobita7876 2 жыл бұрын
Thank you for this great video well explained Mohamad! Please can you help me on saving related entities. I means by that save an entity that has a foreign key of first saved one. Thanks in advance !
@orlandojoaobita7876
@orlandojoaobita7876 2 жыл бұрын
Please not that I am not using Guid, I left the database to generate the Id.
@ss-de5im
@ss-de5im 3 жыл бұрын
спасибо
@viktorolsson634
@viktorolsson634 2 жыл бұрын
Can someone please explain. In the genericrepository. Why do we need applicationDbContext there when we dont use the instance in that class?
@luisandrade9054
@luisandrade9054 2 жыл бұрын
Hey, that's a good question! I wonder the same. I consider you may not need it as a property for the GenerecirRepository class but you do need it to initialize instance of dbSet property. I just test it this way and it worked. public class GenericRepository : IGenericRepository where T : class { private readonly ILogger _logger; protected DbSet _dbSet; public GenericRepository( ApplicationDbContext context, ILogger logger) { _logger = logger; _dbSet = context.Set(); // Right in here } ... }
@olegalekos2181
@olegalekos2181 2 жыл бұрын
It is a bad exmaple and practice. I was wondering the same.
@umeryounas8733
@umeryounas8733 3 жыл бұрын
Subscribed plz add section to query related data using repo thank you
@MTSightseeing
@MTSightseeing Жыл бұрын
can you tell me extension dotnet in visual studio code
@mimrankhan9974
@mimrankhan9974 2 жыл бұрын
If i have 100 of repository how do i manage in unite of work
@arunbm123
@arunbm123 2 жыл бұрын
you have not implemented transactions ?
@codeforme8860
@codeforme8860 2 жыл бұрын
So many coding issues whit this. You should not return bullion on a task, you should return the task result. Do not use IEnumerable it can cause performance issues. If you have a DB exception, you should feed that back the exception up the application Delete is over engendered Code review grade C
@kedarkulkarin78
@kedarkulkarin78 6 ай бұрын
github code is not available it seems
@tothedust
@tothedust 3 жыл бұрын
First
@zcoderminer
@zcoderminer 2 жыл бұрын
On video timeline kzbin.info/www/bejne/Y5vGl2SHpp10Y5Y down to kzbin.info/www/bejne/Y5vGl2SHpp10Y5Y is wrong implementations.
@NG-tn8cn
@NG-tn8cn 2 жыл бұрын
Why it's wrong? what can be improved is that there is already a selection method by id, so in the update method the other method can be called
@compman73
@compman73 3 жыл бұрын
The Repository & Unit-of-work pattern isn’t useful with EF Core. EF Core already implements a Rep/UoW pattern, so layering another Rep/UoW pattern on top of EF Core isn’t helpful. A better solution is to use EF Core directly, which allows you to use all of EF Core’s feature to produce high-performing database accesses.
@Ranjeetsingh-bw4im
@Ranjeetsingh-bw4im 3 жыл бұрын
Hey Alireza, EF provides Dbset (Which you can compare with individual repository) but if you will use dbset all over the application then your application will be tightly coupled with ef core, In future if you will want to change the ORM then it will be very difficult. If you would have used repository then you just need to change your repository implementation.
@compman73
@compman73 3 жыл бұрын
@@Ranjeetsingh-bw4im Agree 👍
@olegalekos2181
@olegalekos2181 2 жыл бұрын
Nah, it is not used for the same reasons.
@jayakumar2927
@jayakumar2927 Жыл бұрын
source code
@jayakumar2927
@jayakumar2927 Жыл бұрын
any update?
@myworldbox
@myworldbox 11 ай бұрын
Repository Pattern is trash = = redundancy only
Unit of Work in ASP.NET Core
14:57
Raw Coding
Рет қаралды 20 М.
НИКИТА ПОДСТАВИЛ ДЖОНИ 😡
01:00
HOOOTDOGS
Рет қаралды 3 МЛН
ROSÉ & Bruno Mars - APT. (Official Music Video)
02:54
ROSÉ
Рет қаралды 204 МЛН
😜 #aminkavitaminka #aminokka #аминкавитаминка
00:14
Аминка Витаминка
Рет қаралды 2,3 МЛН
Generic Repository and Unit of Work .NET 7: A Comprehensive Guide
1:11:29
Code Unparalleled
Рет қаралды 26 М.
Using Unit of Work Pattern
13:43
Study Mash
Рет қаралды 35 М.
.NET 8  💥  - Logs Dashboard with Serilog & SEQ
11:55
Mohamad Lawand
Рет қаралды 2,8 М.
What’s Up with Laravel? It’s Everywhere, and Here’s Why!
6:22
Getting Started with Dapper in .NET
11:29
Amichai Mantinband
Рет қаралды 13 М.
Secure a .NET Core API with Bearer Authentication
1:06:56
Les Jackson
Рет қаралды 191 М.
Do NOT Learn Kubernetes Without Knowing These Concepts...
13:01
Travis Media
Рет қаралды 313 М.