public List <Transaction> GetAll(Expression <Func <Transaction, bool> > filter = null) { using (BankContext context = new BankContext(_options)) { return(filter == null ? context.Set <Transaction>().ToList() : context.Set <Transaction>().Where(filter).ToList()); } }
public Account Get(Expression <Func <Account, bool> > filter) { using (BankContext context = new BankContext(_options)) { return(context.Set <Account>().SingleOrDefault(filter)); } }
public Transaction Get(Expression <Func <Transaction, bool> > filter) { using (BankContext context = new BankContext(_options)) { return(context.Set <Transaction>().SingleOrDefault(filter)); } }
internal Customer CreateExistingCustomer(BankContext context) { City existingCity = CreateExistingCity(context); Customer existingCustomer = new CustomerBuilder().WithZipCode(existingCity.ZipCode).Build(); context.Set <Customer>().Add(existingCustomer); context.SaveChanges(); return(existingCustomer); }
//private static readonly Logger _logger = NLog.LogManager.GetCurrentClassLogger(); public DbRepository(BankContext bankContext) { _bankContext = bankContext; if (typeof(T).BaseType == typeof(BaseQuery)) { _dbQuery = _bankContext.Query <T>(); } else { _dbSet = _bankContext.Set <T>(); } }
public BaseRepository(BankContext context) { _context = context; entities = _context.Set <T>(); }
public AccountsRepository(BankContext context) { _context = context; _accountsEntity = context.Set <Account>(); }
public async Task <List <T> > GetAll <T>() where T : BaseEntity { return(await _context.Set <T>().ToListAsync()); }
public GenericRepository(BankContext context) { _context = context; _entities = context.Set <TEntity>(); }
public Repository(BankContext context) { _context = context; _entity = _context.Set <T>(); }
public async Task Add(TEntity entity) { BankContext.Set <TEntity>().Add(entity); await BankContext.SaveChangesAsync(); }
public Repository() { this._context = new BankContext(); this._dbSet = _context.Set <T>(); }
public void AddItem(T item) { _bankContext.Set <T>().Add(item); }
public Repository(BankContext dbContext) { this.dbContext = dbContext; dbSet = dbContext.Set <T>(); }
public void Create(T entity) { _context.Set <T>().Add(entity); }
public UsersRepository(BankContext context) { _context = context; _usersEntity = context.Set <User>(); }
public Repository(BankContext context) { this.context = context; this.dbSet = context.Set <TEntity>(); }
public Repository(BankContext context) { Db = context; DbSet = Db.Set <TEntity>(); }
public RepositoryBase(BankContext context) { db = context; dbSet = context.Set <T>(); }