Exemple #1
0
 /// <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);
 }
Exemple #2
0
 /// <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;
 }