Dec 22, 2014 07:58 AM|mdsadullah718|LINK
After reading your comments, i googled more for Repo and UOW to dive in deep and found an article in MSDN which says ,
In many applications, the business logic accesses data from data stores such as databases, SharePoint lists, or Web services. Directly accessing the data can result in the following:
A higher potential for programming errors
Weak typing of the business data
Difficulty in centralizing data-related policies such as caching
An inability to easily test the business logic in isolation from external dependencies
Use the Repository pattern to achieve one or more of the following objectives:
You want to maximize the amount of code that can be tested with automation and to isolate the data layer to support unit testing.
You access the data source from many locations and want to apply centrally managed, consistent access rules and logic.
You want to implement and centralize a caching strategy for the data source.
You want to improve the code's maintainability and readability by separating business logic from data or service access logic.
You want to use business entities that are strongly typed so that you can identify problems at compile time instead of at run time.
You want to associate a behavior with the related data. For example, you want to calculate fields or enforce complex relationships or business rules between the data elements within an entity.
You want to apply a domain model to simplify complex business logic.
Complete topic in msdn.microsoft.com/en-us/library/ff649690.aspx
A repository separates the business logic from the interactions with the underlying data source or Web service. The separation between the data and business tiers has three benefits:
It centralizes the data logic or Web service access logic.
It provides a substitution point for the unit tests.
It provides a flexible architecture that can be adapted as the overall design of the application evolves.
What's your opinion from these article ? As you have expressed your opinion that there is nothing wrong with having DbContext in your BLL layer. But this MSDN article is saying that separating Dbcontext from BLL is right way !! Am
expecting your opinion on this . Thanks