/// <summary> /// Constructor which takes a db context and wires up the stores with default instances using the context /// </summary> /// <param name="context"></param> public EntityStore(DbContext context) { if (context == null) { throw new ArgumentNullException("context"); } Context = context; _entityStore = new BaseEntityStore <TEntity>(context); }
/// <summary> /// If disposing, calls dispose on the Context. Always nulls out the Context /// </summary> /// <param name="disposing"></param> protected virtual void Dispose(bool disposing) { if (DisposeContext && disposing && Context != null) { Context.Dispose(); } _disposed = true; Context = null; _entityStore = null; }