Repository pattern in asp net core

  Рет қаралды 308,560

kudvenkat

kudvenkat

Күн бұрын

Пікірлер
@vinteetatha
@vinteetatha 5 жыл бұрын
You are making so developers' life easier! While in this world, everything has a price, you are spreading valuable knowledge free. You are just awesome!
@newageeducation5908
@newageeducation5908 4 жыл бұрын
this is youtube marketing bro, this video won't teach you anything, but it will make you interested in buying his course
@TheUjjwalpandey
@TheUjjwalpandey 4 жыл бұрын
@@newageeducation5908 It's teaching us a lot.
@brazenbull36
@brazenbull36 4 жыл бұрын
@@newageeducation5908 Wrong. His youtube videos are some of the best resources on the internet.
@tusharkukreti7448
@tusharkukreti7448 3 жыл бұрын
@@newageeducation5908 The content and knowledge Venkat gives in his course for free, that, others charges 100s of bucks for the same.
@meghabachu
@meghabachu 3 жыл бұрын
@@newageeducation5908 bro urs wrong assumption. Pls remove ur assumption . his video's helped a lot. It's free of cost.
@markkeller6917
@markkeller6917 5 жыл бұрын
Venkat is an awesome teacher. Easy to understand and all his material is very practical. He's almost always my go to source.
@markobradonjic3192
@markobradonjic3192 5 жыл бұрын
This is by far the best explanation of the Repository pattern on the freakin' Internet to date, when I say far I mean like the distance from the MIlky Way to the end of the Universe far. Mate... great job keep it going.
@Csharp-video-tutorialsBlogspot
@Csharp-video-tutorialsBlogspot 5 жыл бұрын
Hello Marko - Thank you very much for taking time to give feedback. This means a lot. I am very glad you found the videos useful. Good luck and all the very best with everything you are doing.
@ronjones1587
@ronjones1587 5 жыл бұрын
I learned a lot from this Video Series and I have a new job right now, thank you man !
@Csharp-video-tutorialsBlogspot
@Csharp-video-tutorialsBlogspot 5 жыл бұрын
Hello Ron - Wow....Hearty Congratulations. Very happy for you. Thank you very much for taking time to share the good news. It's an honour. Good luck and all the very best with your new role.
@manjinderbajwa1468
@manjinderbajwa1468 4 жыл бұрын
Nice dear God bless
@Leng.sovandara
@Leng.sovandara 4 жыл бұрын
me too.
@alrtdev8256
@alrtdev8256 4 жыл бұрын
This channel never fails to disappoint me. Learned C# from 2013 with Kudvenkat. Thank you very much! and more power!
@abeldaniel2245
@abeldaniel2245 4 жыл бұрын
When I have a headache in coding I will come to Venkat clinic!!!
@sushensharma4730
@sushensharma4730 5 жыл бұрын
This is height of coincidence ! ,..I was just going through few youtube videos about repository pattern ,but was not satisfied with their explanation .I was thinking in my my mind ,i wish kudvenkat could have uploaded video on same topic ...and allas! video poped up in my recommendation with uploaded time 7 minutes ago
@rajeshselvam564
@rajeshselvam564 5 жыл бұрын
I'm learning lot of technology things from your tutorials... Really superb...
@sachingotal11
@sachingotal11 5 жыл бұрын
Waiting for the next video to be uploaded. The explanations here are SUPER AWESOME! Thank you very much for making such great tutorials.
@talalshafiq3452
@talalshafiq3452 5 жыл бұрын
Most clear and simple lecture on repository pattern i have came accross. Thank you sir. Love & Respect.
@darkogele
@darkogele 5 жыл бұрын
Its Insane how good this thing is i love Venkat man :D
@frankromeo3351
@frankromeo3351 4 жыл бұрын
Excellent! Very concisely describes how and why to use the repository pattern!
@RudraPratapSinghLearning
@RudraPratapSinghLearning 3 жыл бұрын
It's a really amazing and simple explanation. Thanks a lot Kudvenkat. I regret taking a course at Naresh IT, Hydrabad. They wasted my time and money. Thanks again Kudvenkat.
@ashiquebinraheem
@ashiquebinraheem 5 жыл бұрын
I did seen many videos to understand the loosly couple feature of dependency injection. I found the exact loosly coupling example in this.also, i did watch your other videos in learn dotnet core section.every one is awsome. Thanks you sir for the nice videos..
@Csharp-video-tutorialsBlogspot
@Csharp-video-tutorialsBlogspot 5 жыл бұрын
Hello Ashique - Thank you very much for taking time to give feedback. This means a lot. I am very glad you found the videos useful.
@BigyanChap
@BigyanChap 2 жыл бұрын
Great video to learn if you are new and refresh the knowledge if you are old developer.
@shrutisahay216
@shrutisahay216 5 жыл бұрын
Thank you so much for all your efforts, the description is also so informative , which proves your complete dedication that too for free, Really thank you sir , following you since college , my all major minor projects are becoz of you.
@Csharp-video-tutorialsBlogspot
@Csharp-video-tutorialsBlogspot 4 жыл бұрын
Hello Shruti - Thank you very much for the feedback. Means a lot. I have included all the ASP .NET Core tutorial videos, slides and text articles in sequence on the following page. Hope you will find it handy. www.pragimtech.com/courses/asp-net-core-mvc-tutorial-for-beginners/ When you have some time, can you please leave your rating and valuable feedback on the reviews tab. It really helps us. Thank you. Good luck and all the very best with everything you are doing.
@poojadhamankar8604
@poojadhamankar8604 4 жыл бұрын
It is such a clean, clear and up to the mark explanation
@IsmaelBarri
@IsmaelBarri 5 жыл бұрын
I have a question, at 05:17 We are coping properties of employeeChanges to employee, but employee already equals to employeeChanges at line 51, why should we copy the properties again?
@djnew-e6j
@djnew-e6j 4 жыл бұрын
Hi Venkat, Great explanation. I have one question regarding AddScoped. What will happen if I use AddSingleton instead of AddScoped? I know the difference between them but I did not understand the real time benefit of using AddScoped in this video.. What is the advantage of using AddScoped? Can you please explain? Thanks
@TheAhmedasdasd
@TheAhmedasdasd 4 жыл бұрын
if you know the answer tell me?
@sixaintnine
@sixaintnine 3 жыл бұрын
Same question :/ Can anyone help for future viewers?
@chaoticmind-z
@chaoticmind-z 3 жыл бұрын
wow...just wow...you are truly amazing!! What a gem. God bless you
@hshlom
@hshlom 3 жыл бұрын
As usual, another useful video from kudvenkat. But one question - 8:42 - Return the deleted employee? How is that possible?
@nifraz
@nifraz 2 жыл бұрын
The moment you call dbContext.SaveChanges() after calling Remove(employee), the employee record will get deleted from the database. But you still have a reference to the corresponding employee object. You can use that for logging etc.
@prashantbiradar7896
@prashantbiradar7896 5 жыл бұрын
I need to find out special word to say thank you...!!!☺️
@ogmiga
@ogmiga 5 жыл бұрын
Thank you so much Venkat. You have really done well. I have a question. If we have 100+ repositories, are we suppose to list all of them in the ConfigureServices Method? That I feel might be difficult to manage. Your advice please. Thank you
@Leng.sovandara
@Leng.sovandara 4 жыл бұрын
I have this question too. Do you have answer yet?
@MmMm-tg5mq
@MmMm-tg5mq 5 жыл бұрын
very informative , concentrated and clear . If I can give more than one like I will give million likes, THANKS A LOT HERO
@saleemthuvvur7510
@saleemthuvvur7510 5 жыл бұрын
I am getting this exception, whats wrong with me? InvalidOperationException: The DbContext of type 'AppDbContext' cannot be pooled because it does not have a single public constructor accepting a single parameter of type DbContextOptions.
@MazharJavaid
@MazharJavaid 5 жыл бұрын
Same. Did you find solution ?
@saleemthuvvur7510
@saleemthuvvur7510 5 жыл бұрын
Yes.. I resolved
@MazharJavaid
@MazharJavaid 5 жыл бұрын
@@saleemthuvvur7510 please explain the solution #saleem. THAnks
@coolwaterdvr
@coolwaterdvr 5 жыл бұрын
Clear explanation of the repository pattern. Thank you Venkat. 👍
@iancarr3923
@iancarr3923 5 жыл бұрын
Your videos are very useful, thanks. Your diction is excellent!
@raghufriend159
@raghufriend159 5 жыл бұрын
what happens if I use AddSingleton instead of AddScoped to persist the same repository instance across all http requests
@TheAhmedasdasd
@TheAhmedasdasd 4 жыл бұрын
Do you know the answer?
@trustingod0
@trustingod0 5 жыл бұрын
I'm getting a red squiggley line in the following code Department = Dept.HR in the MockEmployeeRepository. Should I have some Properties in the Department Class? Thanks !
@Csharp-video-tutorialsBlogspot
@Csharp-video-tutorialsBlogspot 5 жыл бұрын
Hello Ronald - Here is the Dept enum. Hope this helps. namespace EmployeeManagement.Models { public enum Dept { None, HR, IT, Payroll } }
@girishparganiha3694
@girishparganiha3694 5 жыл бұрын
Very Nicely Explained the concept. Thank You ...!!!
@anand0901
@anand0901 7 ай бұрын
Best explanation I have seen so far
@tomcork1790
@tomcork1790 4 жыл бұрын
Amazing videos @kudvenkat Used this to help me complete some of the implementation for my dissertation.
@AbdulSamad-ct9io
@AbdulSamad-ct9io 5 жыл бұрын
Any video reference to understand the concept of generic repository and Unit of Work pattern. Thanks
@berkut2006
@berkut2006 5 жыл бұрын
Damn, outstanding tutorial Thank you
@yogibobo1
@yogibobo1 5 жыл бұрын
Really good explaination. Thank you very much !!!
@mahishasworld
@mahishasworld 4 жыл бұрын
hi venkat, one question in realtime scenario will use only with one databse(SQl,Oracle,..) we don''t need to create repositories multiple, Then how this repository pattern useful.
@conaxlearn8566
@conaxlearn8566 4 жыл бұрын
Seperation of concerns. Back in the days when we were using ADO, we also created a data access layer that gets data from SQL and pass back to the caller which is the business logic layer. I see this repository pattern is pretty much doing the same thing.
@john-blair
@john-blair Жыл бұрын
Why would you not use a singleton for the IEmployeeRepository? Thanks.
@basilio100
@basilio100 4 жыл бұрын
Some people say that Repo pattern over EntityFramework is antipattern. EntityFW is already repository. Also not sure if .Save() inside of each repo method is good idea. What if you need to do few entity operations during request - then it will be few DB transactions. Probably better to have BaseRepo where you do generic retrival, update, create and save operations.
@norbertotriemstra466
@norbertotriemstra466 5 жыл бұрын
What editing feature you use to copy withing Visual Studio ?
@microtech2448
@microtech2448 5 жыл бұрын
Nicely explained but it seems similar to video on DI. Again the same doubt how one can have reference of multiple store repository at the same time, in this case InMemory and SQL repositories and use one on the fly as per requirement?
@chrisdan81
@chrisdan81 5 жыл бұрын
Hi. Does that repository can also be use to other classes or entities like department, product, customer tables? Thank you
@rottipaani
@rottipaani 3 жыл бұрын
Great❤❤❤
@niemaszglowy
@niemaszglowy 4 жыл бұрын
Why would we need a repository? Can't we directly implement those CRUD methods in a service? Like EmployeeService which has a readonly private AppDbContext to work with? Why add another layer (repository)? Or am I just mistaking naming conventions and in this video Repository is a sort of Service?
@sulaimanahmedz5826
@sulaimanahmedz5826 5 жыл бұрын
Hi Mr. kudvenkat can you make videos on angular 7 and asp.net core web api implementation.
@ManishSingh-zh8jz
@ManishSingh-zh8jz 2 жыл бұрын
Thank you for saving my career
@conaxlearn8566
@conaxlearn8566 4 жыл бұрын
At 4:05 and several other places, why not just reuse the GetEmployee method instead of calling _employeeList.FirstOrDefault?
@CarlosWashingtonMercado
@CarlosWashingtonMercado 11 күн бұрын
It would be great to have some videos in this playlist about unit testing with the IEmployeeRepository registry.
@DecentProgrammer
@DecentProgrammer 4 жыл бұрын
Nice Video. Thanks Sir
@pkcc9381
@pkcc9381 5 жыл бұрын
Why not AddSingleton for the SQLEmployeeRepository service?
@swimmorning
@swimmorning 5 жыл бұрын
Not sure if this has already been answered or not, but if you do AddSinglton an exception will be thrown: Singleton ImplementationType: EmployeeManagement.Models.SQLEmployeeRepository': Cannot consume scoped service 'EmployeeManagement.Models.AppDbContext' from singleton 'EmployeeManagement.Models.IEmployeeRepository
@nitro-boy09
@nitro-boy09 5 жыл бұрын
This question might be out of topic, but how can you register DI outside of compile time to make it more configurable without recompiling?
@steveymcneckbeard
@steveymcneckbeard 5 жыл бұрын
I don't understand your question. Do you mean in a separate project/ class library?
@nitro-boy09
@nitro-boy09 5 жыл бұрын
@@steveymcneckbeard I mean register dependencies using an external file or config file so nobody has to recompile codes.
@shahidwani6445
@shahidwani6445 5 жыл бұрын
Sir, make a video on onion architecture as well. Thank you very much for teaching us.
@orlandojoaobita7876
@orlandojoaobita7876 5 жыл бұрын
Of course! Onion architecture explained by Mr Venkat will be very easy to understand as he knows how to bring difficult contexts simple and clear. Thanks to him for help developers.
@brianlaudrupchannel
@brianlaudrupchannel 4 жыл бұрын
Do you recommend using the generic repository pattern?
@dennisgonzales9521
@dennisgonzales9521 4 жыл бұрын
Thank you for the awesome video.
@puneetkankar
@puneetkankar 5 жыл бұрын
very helpful and nice explanation sir.
@thandrapatinitisha2162
@thandrapatinitisha2162 26 күн бұрын
What if we wanted to use both sqlrepository and inmemory..How to register in startup class and make use of both
@nammozhi819
@nammozhi819 2 жыл бұрын
Thanks for sharing knowledge
@srikanthek737
@srikanthek737 5 жыл бұрын
How to consume stored procedure and views with EF Core ?, it looks complicated compared earlier EF, can you please give some lessons using dapper
@ypwygk652
@ypwygk652 4 жыл бұрын
thanks very very much, please continue
@xaviercompagnion5309
@xaviercompagnion5309 5 жыл бұрын
Sir, will you talk about asynchronous programming in the repository pattern ? Regards
@ajaypanse4489
@ajaypanse4489 Жыл бұрын
Hello Venkat, Your all videos are excellent & easy to understand. Can you make video on "Unit Of Work" Pattern with example.
@zerosandones7547
@zerosandones7547 3 жыл бұрын
do we put our "repositories" in the models folder?
@dotnetdevni
@dotnetdevni 4 жыл бұрын
I thought ef core suggests that you don’t use repository pattern it slows it down when it already implements.
@MmMm-tg5mq
@MmMm-tg5mq 5 жыл бұрын
great trainer thanks thanks thanks :)
@rohan637
@rohan637 5 жыл бұрын
Thank you for the upload
@rishisharma1066
@rishisharma1066 5 жыл бұрын
Thanks Sir I learn a lot from you Why not singleton object of sql repository
@rishisharma1066
@rishisharma1066 5 жыл бұрын
When to use pros and cons
@TheAhmedasdasd
@TheAhmedasdasd 4 жыл бұрын
Do you know the answer?
@haizzengunn9350
@haizzengunn9350 3 жыл бұрын
very informative vid, great job!!
@VirajChokhany
@VirajChokhany 3 жыл бұрын
Sir can you say how is AppDbContext injected in SQLEmployeeRepository? I am not able to understand this part
@balakrishnanganesan5008
@balakrishnanganesan5008 4 жыл бұрын
Thank you for the video. very useful
@michaelkut7711
@michaelkut7711 5 жыл бұрын
from where we are injecting the AppDbContext to the SQLEmployeeRepository constructor as a parameter !?
@elranoved
@elranoved 3 жыл бұрын
is that code thread safe ? what about case the 2 requests are trying to change employee details ? anyway love your videos! perfect teacher.
@MrSyedimranbasha
@MrSyedimranbasha 4 жыл бұрын
Thanks for posting the video. This is very useful. Can you post link to download source code of the project shown in the video.
@vinodnagda9395
@vinodnagda9395 2 жыл бұрын
I am not getting error cannot open databse . I am getting the error Object reference not set to an instance of an object. @foreach (var employee in Model). Please help me on the same.
@sajadtorkamani9399
@sajadtorkamani9399 4 жыл бұрын
Great video!
@Rajeshsingh-ws5th
@Rajeshsingh-ws5th 3 жыл бұрын
Still its hard coded in startup. what if we want on conditional basis.
@lynnchen4048
@lynnchen4048 4 жыл бұрын
sorry sir,i dont think repository pattern is neccesary.We 've created the dbContext instance by depency injection,why not just use the methods of our appDBContext to access the database in the controller action method?
@conaxlearn8566
@conaxlearn8566 4 жыл бұрын
A lot of the topics that Venkat teaches may seem unnecessary in small projects. But he's preparing you for when you go into larger and complex projects. Having a repository class ensures you retrieve data the same way everytime, as you may require the same data from more than one business logic layer components.
@marcioalexandremarcondes557
@marcioalexandremarcondes557 3 жыл бұрын
Thank you for this!
@krishramakrishna9567
@krishramakrishna9567 5 жыл бұрын
we have to write seperate repo for every table in database
@SuperOnlyP
@SuperOnlyP 5 жыл бұрын
Sir, why is private context not defined as _context in: private readonly AppDbContext context;
@naodagere8210
@naodagere8210 4 жыл бұрын
Marvelous!
@itratsheikh1803
@itratsheikh1803 4 жыл бұрын
Really sir you are awesome!
@kalpom
@kalpom 5 жыл бұрын
can you please make one video of common repository and unit of work patterns as well?
@A4amenvi
@A4amenvi 5 жыл бұрын
Please can you up thing one step by making a Generic Repository Pattern. Thank you
@gauravverma7914
@gauravverma7914 5 жыл бұрын
Sir how attach SEO framework in asp.net core
@mudasirbhat126
@mudasirbhat126 4 жыл бұрын
Hello Sir HTTP Error 500.30 - ANCM In-Process Start Failure I got this error while running the project, how to fix this ? As I have done the same things that you have done in the project so far. Please Reply as soon as possible
@gangadharkaranapu9062
@gangadharkaranapu9062 4 жыл бұрын
what's there in repository pattern. I am feeling like the interface-implementation concept only
@gangwargajendra
@gangwargajendra 5 жыл бұрын
Sir plz make vedios on react js. Which will be implement in mvc core.
@coolwaterdvr
@coolwaterdvr 5 жыл бұрын
Thanks Venkat.
@ivandrofly
@ivandrofly 5 жыл бұрын
Repository Pattern is one of the best pattern
@basselbeiroumi1045
@basselbeiroumi1045 4 жыл бұрын
If you have problems running the pogram it might be because you don't have the default page as index just put app.UseMvcWithDefaultRoute(); before app.UseMvc(routes => { routes.MapRoute("default", "{controller=Home}/{action=Details}/{id=2}"); }); and it should work (version 3.1)
@RachitJain4U
@RachitJain4U 3 жыл бұрын
Thank You Sir :)
@pritpalkaur5582
@pritpalkaur5582 5 жыл бұрын
You rock sir
@mayankpriyadarshi9346
@mayankpriyadarshi9346 4 жыл бұрын
Thanks buddy
@mystique87
@mystique87 5 жыл бұрын
Long live to you sir
@HiYoutuberLog
@HiYoutuberLog 9 ай бұрын
Thank you sir ji
@prathameshshende4
@prathameshshende4 2 жыл бұрын
Why you don't use Async in Repository?
@robmays6982
@robmays6982 5 жыл бұрын
excellent
@eugene-white-shark
@eugene-white-shark 3 жыл бұрын
thank you
@scceconiprodcomsrl5723
@scceconiprodcomsrl5723 5 жыл бұрын
So not this one ( video and tutorial) is great, all your videos are, but when one tutorial with Data Access and stored procedures , for those who has already databases ,stored procedures, triggers..etc? Thanks
@coderggk6819
@coderggk6819 4 жыл бұрын
1) Why AddScoped and not AddSingleton?
@conaxlearn8566
@conaxlearn8566 4 жыл бұрын
You will hit an error if you use AddSingleton. This is because internally services.AddDbContext adds the context as a scoped service and you can't use a scoped service inside a singleton service. Singleton service - Instance created on first request, stays alive and shared by all users until the application shuts down. Scoped service - Instance created on first request of a web request, stays alive and used only by the same web request. So why is the dbcontext added as scoped instead of singleton? Because * We would not want to have a dbcontext service to be shared by multiple users. * If it is a singleton service, it will stay alive and keep using more and more system resources for the hundreds and thousands or even millions of database calls and will soon crash the application.
@sachingreat222
@sachingreat222 4 жыл бұрын
Plz let me know control period key
@meghachaudhari3738
@meghachaudhari3738 2 жыл бұрын
Please send home controller file coding
@potatodroid2
@potatodroid2 5 жыл бұрын
Implementation for Update method in MockEmployeeRepository, as shown here, should not work. Instead the code below should. public Employee Update(Employee employee) { int Id = employee.Id; int index = _employeeList.FindIndex(e => e.Id == employee.Id); _employeeList[index].Name = employee.Name; _employeeList[index].Email = employee.Email; _employeeList[index].Department = employee.Department; return employee; }
Entity framework core migrations
8:05
kudvenkat
Рет қаралды 227 М.
Каха и дочка
00:28
К-Media
Рет қаралды 3,4 МЛН
Tuna 🍣 ​⁠@patrickzeinali ​⁠@ChefRush
00:48
albert_cancook
Рет қаралды 148 МЛН
Network Rescue 6 - Moving Day
11:03
TCI Productions
Рет қаралды 2,1 М.
AddSingleton vs AddScoped vs AddTransient
15:23
kudvenkat
Рет қаралды 217 М.
ASP NET Core dependency injection tutorial
9:28
kudvenkat
Рет қаралды 431 М.
Repository Pattern with C# and Entity Framework, Done Right | Mosh
26:24
Programming with Mosh
Рет қаралды 876 М.
File upload in asp net core mvc
23:12
kudvenkat
Рет қаралды 189 М.
Middleware in ASP NET Core
8:18
kudvenkat
Рет қаралды 358 М.
Top 20 Interview Questions - Web API - .NET C#
42:22
Interview Happy
Рет қаралды 237 М.
Software Architecture and Design Patterns Interview Questions
1:42:28
Routing in ASP NET Core MVC
12:01
kudvenkat
Рет қаралды 191 М.