0
Reply

EF Generic Repository and Unit of work for Multiple contexts

Naresh Kumar

Naresh Kumar

Sep 11 2015 3:54 AM
1.2k
Implementing Unit of Work with Generic Repository for an application having multiple contexts and each context referring to different database. 
Any help would be highly appreciated.
 
public class GenericRepository<TEntity> where TEntity : class { internal SchoolContext context; internal DbSet<TEntity> dbSet; public GenericRepository(SchoolContext context) { this.context = context; this.dbSet = context.Set<TEntity>(); }