Why need Repository Pattern? It is not a good idea to access the database logic directly in the business logic (MVC controller). The Direct access to the data in the business logic creates multiple problems. 1. Duplicate data access code throughout the business layer. 2. Business logic cannot be tested properly. 3. So may difficulty for Unit Test of the business logic. 4. And so on. Stayed Informed - Object Oriented Programming Concepts (OOPs) What is Repository Pattern? The Repository Pattern separates the logic that retrieves the data and maps it to the entity model from the business logic that acts on the model. The Repository Pattern hides the details of how exactly the data is being fetched or persisted from/to the database. The Repository Pattern works between the data source layer and the business layers of the applicat...
Angular, React, JavaScript, Java, PHP, SQL, C#, Vue, NodeJs, TypeScript and Interview Questions Answers