As far as I've learned, the IRepository
should contain CRUD
. Then we inherit this IRepository
in our other Interfaces like IProduct
and implement IProduct
concrete class ProductRepository
, with methods like GetAllProducts()
, Top5Products()
.
We could also do the same with n-tier architecture. like,
Creating DAL Class Library
and in it define a class Product
with methods like GetAllProducts()
, Top5Products()
.
In both DAL.Product
and Repo.ProductRepository
classes we initialize DB Context
of Entity Framework
and query our relevant data.
The calling is similar in both Repo.ProductRepository
or DAL.Product
methods from BLL
In view of these similarities, my question what is the benefit of Repos?
I can do the same with much ease using n-tier architectures with (Controller
,BLL Class Library
, DAL Class Library
).