Exemple #1
0
        public EfDbSetWrapper(IEfDbContext context)
        {
            Guard.WhenArgument(context, "context").IsNull().Throw();

            this.Context = context;
            this.DbSet   = this.Context.Set <T>();
        }
Exemple #2
0
        public EfDbSetWrapper(IEfDbContext efDbContext)
        {
            Guard.WhenArgument(efDbContext, "efDbContext").IsNull().Throw();

            this.efDbContext = efDbContext;

            this.dbSet = efDbContext.Set <T>();
        }
Exemple #3
0
 public EfTransactionApi(
     IDbContextTransaction dbContextTransaction,
     IEfDbContext starterDbContext,
     ICancellationTokenProvider cancellationTokenProvider)
 {
     DbContextTransaction      = dbContextTransaction;
     StarterDbContext          = starterDbContext;
     CancellationTokenProvider = cancellationTokenProvider;
     AttendedDbContexts        = new List <IEfDbContext>();
 }
        protected virtual void Dispose(bool disposing)
        {
            if (!disposing)
            {
                return;
            }
            if (Context == null)
            {
                return;
            }

            Context.Dispose();
            Context = null;
        }
 public $EntityName$Repository(IEfDbContext context) : base(context)
Exemple #6
0
        public EfDbContextSaveChanges(IEfDbContext dbContext)
        {
            Guard.WhenArgument(dbContext, "dbContext").IsNull().Throw();

            this.dbContext = dbContext;
        }
 public EfRepository(IEfDbContext dbContext, ICompoundKeyCachingStrategy <T, TKey, TKey2> cachingStrategy = null)
     : base(dbContext, cachingStrategy)
 {
 }
 internal EfRepositoryBase(IEfDbContext dbContext, ICachingStrategy <T, TKey> cachingStrategy = null) : base(cachingStrategy)
 {
     this.Context = dbContext;
     DbSet        = Context.Set <T>();
 }
 internal EfCompoundKeyRepositoryBase(IEfDbContext dbContext, ICompoundKeyCachingStrategy <T> cachingStrategy = null)
     : base(cachingStrategy)
 {
     Context = dbContext;
     DbSet   = Context.Set <T>();
 }
Exemple #10
0
 public EfDatabaseApi(IEfDbContext dbContext)
 {
     DbContext = dbContext;
 }
 public EfTransactionApi(IDbContextTransaction dbContextTransaction, IEfDbContext starterDbContext)
 {
     DbContextTransaction = dbContextTransaction;
     StarterDbContext     = starterDbContext;
     AttendedDbContexts   = new List <IEfDbContext>();
 }