EF Codefirst with Design Patterns

I frequently use codefirst approach of  Entity Framework in my asp.net mvc projects. Thefore I want to do much more flexible,independency using design patterns and that project is output. Briefly; Factory Pattern : ContextFactory Singleton Pattern : ContextFactory and UnitOfWork UnitOfWork Pattern  Repository Pattern :  Generic Repository Decorator Pattern : RepositoryDecoratorBase – CachableRepository, LoggableRepository, AuditableRepository Dependency Injection : …

Continue reading ‘EF Codefirst with Design Patterns’ »

EF Codefirst Approach, Context Factory, Generic Repository Pattern, Unit of Work Pattern

Firstly i want to take a look at Generic Repository and Unit Of  Work Design Pattern. Repository Concept: Separate business code from data access Encapsulate data access Anytime you need data persistence Unit Of Work Concept: You can prefer for effecient data access Manage concurrency problems and transactions Now, Let’s write code for Context Factory …

Continue reading ‘EF Codefirst Approach, Context Factory, Generic Repository Pattern, Unit of Work Pattern’ »