Why Wrapping DBSet inside the User Defined Class
is a Good idea?
DBSet is a Repository that is used to query
and command the underlying database tables.
We need this object in our code to manipulate
data inside tables.
Using this Class direcly inside the Conroller
make UI dependent of EF.
In order push it outside the UI, we need to
wrap DBSet along with DBContext in User Defined class and use that user defined
class in the Conroller.
Make code SOC, Testable, Reusable
No comments:
Post a Comment