Repository pattern reduce the controller code complexity. We write the most of all business logic in Repository with the help of entity frameworks classes. Repository work like a mediator that means its work between business logic and data access layers. Steps of Implementing repository pattern in MVC 5 namespace PCX.Core.Repositories { /// <typeparam name="C"></typeparam> /// <typeparam name="T"></typeparam> public abstract class GenericRepository <C, T> : IGenericRepository <T> where T : class where C : DbContext , new () { private C _entities = new C(); public C Context { get { return _entities; } ...
Angular, React, JavaScript, Java, PHP, SQL, C#, Vue, NodeJs, TypeScript and Interview Questions Answers