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 Жыл бұрын
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.
@31337flamer10 ай бұрын
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 Жыл бұрын
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 Жыл бұрын
Sure, that's actually used very often in real-world projects.
@MateusdeSouzaMorais Жыл бұрын
Excelent video. I am planning to watch all your videos, they are really good and you are approaching such important topics.
@net-programmer Жыл бұрын
Thanks, I appreciate your comment. Have fun!
@vivekkaushik9508 Жыл бұрын
Good videos bro.
@net-programmer Жыл бұрын
Thanks!
@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 Жыл бұрын
Intermediate level, thanks for the comment!
@Tymonello Жыл бұрын
nicely explained!
@Tymonello Жыл бұрын
But aren't you missing a method to download all objects in your repository?
@net-programmer Жыл бұрын
@@Tymonello You can definitely add it. This example was very basic and minimal.