Naresh Kumar

Naresh Kumar

  • NA
  • 7
  • 2.5k

EF Generic Repository and Unit of work for Multiple contexts

Sep 11 2015 3:54 AM
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>(); }