コード例 #1
0
ファイル: EntityStore.cs プロジェクト: PasysxaWebApp/WebApp
 /// <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);
 }
コード例 #2
0
ファイル: EntityStore.cs プロジェクト: PasysxaWebApp/WebApp
 /// <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;
 }