Repository Pattern in C#

  Рет қаралды 6,432

NET Programmer

NET Programmer

Күн бұрын

Пікірлер: 16
@ayoubelhioui2205
@ayoubelhioui2205 Жыл бұрын
thanks for your efforts, instead of making an interface and implementing all the methods, why you didn't use this in the service directly?
@net-programmer
@net-programmer Жыл бұрын
You have to keep in mind that you may need these methods in multiple services, not just this only one. Extracting these methods to repository enables you to use these methods in many places within the application without any problem, by injecting the IRepository into the constructor. Using interfaces makes it easier to switch the implementation of the IRepository easily if it would be necessary in the future.
@31337flamer
@31337flamer 10 ай бұрын
why even have multiple files when you can write your source code into a single line? :D In big applications you should follow SOC seperation of concerns and build interchangable blocks. Interfaces can help force other programmers in your team to support these methods but also keep the application scalable. We want to build interchangable lego bricks so our code can be adapted and executed in every possible Test or Live scenario ;)
@jayschwarz4365
@jayschwarz4365 Жыл бұрын
Do you like the idea of building a generic repository that implements the actual DB calls that is used by all the services?
@net-programmer
@net-programmer Жыл бұрын
Sure, that's actually used very often in real-world projects.
@MateusdeSouzaMorais
@MateusdeSouzaMorais Жыл бұрын
Excelent video. I am planning to watch all your videos, they are really good and you are approaching such important topics.
@net-programmer
@net-programmer Жыл бұрын
Thanks, I appreciate your comment. Have fun!
@vivekkaushik9508
@vivekkaushik9508 Жыл бұрын
Good videos bro.
@net-programmer
@net-programmer Жыл бұрын
Thanks!
@b25671
@b25671 Жыл бұрын
Thanks for the video. I wonder... is this basic - intermediate - or advanced level knowledge? I'm learning a lot of stuff on my own... and have a hard time telling when something is estimated to be basic or advanced. Thanks.
@net-programmer
@net-programmer Жыл бұрын
Intermediate level, thanks for the comment!
@Tymonello
@Tymonello Жыл бұрын
nicely explained!
@Tymonello
@Tymonello Жыл бұрын
But aren't you missing a method to download all objects in your repository?
@net-programmer
@net-programmer Жыл бұрын
@@Tymonello You can definitely add it. This example was very basic and minimal.
@abdullahbinmamun3803
@abdullahbinmamun3803 5 ай бұрын
Thank you so much
@net-programmer
@net-programmer 5 ай бұрын
thanks!
How to use the Repository Design Pattern in C# and ASP.NET
18:35
tutorialsEU - C#
Рет қаралды 14 М.
Don't Use AutoMapper in C#! Do THIS Instead!
16:17
Codewrinkles
Рет қаралды 71 М.
I'VE MADE A CUTE FLYING LOLLIPOP FOR MY KID #SHORTS
0:48
A Plus School
Рет қаралды 20 МЛН
Deep Dive Into the Repository Design Pattern in Python
11:56
ArjanCodes
Рет қаралды 81 М.
Generic Repository Pattern With EF Core - Why It Sucks
9:33
Milan Jovanović
Рет қаралды 43 М.
Паттерны. Репозиторий и сервисный слой
7:22
Repository Pattern
11:08
Coding Concepts
Рет қаралды 69 М.
5 Design Patterns That Are ACTUALLY Used By Developers
9:27
Alex Hyett
Рет қаралды 317 М.
Singleton Design Pattern in C# - Do it THAT way
13:15
tutorialsEU - C#
Рет қаралды 30 М.
What is Dependency Injection?
6:48
Scott Bailey
Рет қаралды 119 М.
Repository Pattern Explained: Can You Afford to Skip It?
2:32
About Clean Code
Рет қаралды 3,8 М.