public EfRepository(IEfContext context) { if (context == null) { throw new ArgumentNullException("context"); } _context = context; }
/// <summary> /// Clear cache /// </summary> /// <param name="context"></param> /// <returns></returns> public static int ClearCache(this IEfContext context) { if (context is DbContextBase ctx) { var changed = ctx.ChangeTracker.Entries().ForEachItem(entry => entry.State = EntityState.Detached); return(changed.Count()); } return(0); }
public StandardRepository(IEfContext context) { this.context = context; dbset = context.Set <TEntity>(); }
public DatasetRepository(IEfContext context) { _context = context; }
public Service(IEfContext efContext, ILogger logger) { this.efContext = efContext; FLogger = logger; }
public DefaultRepository(IEfContext context) { this.context = context; dbset = context.Set <TEntity>(); }