Repository Pattern

To start with lets us take up the two most important questions, “What” and “Why” What is Repository Pattern? Repository pattern is basically a layer to separate the Data access logic, thus avoiding duplication of Data Access Logic. It has direct access to Database, ORM etc. The repository behaves like a collection of data to which we can add, delete and update objects. Why use Repository Pattern? Let us take the example of an MVC application with Entity Framework, now in case of a basic application, we use database context directly inside our controllers, but this creates a tight coupling

Unit Testing Using MOQ Framework

So to start with, most important Concept, that is misunderstood as an unnecessary task by most of the developers – Unit Testing!!! First, let us understand why it is very necessary for a developer to write unit test cases? Deployment: The most basic reason why test cases are written is, when we work in a team, many developers are contributing to the code base, and sometimes even on same modules. In such scenarios, if any developer checks-in a piece of code that breaks the functionality of certain module, unit test cases is the first line of call which alerts us about