Exemple #1
0
        public async Task <IEnumerable <F> > GetAll()
        {
            using (StockTraderDbContext CNTXT = _STDBCF.CreateDbContext())
            {
                IEnumerable <F> GetEntities = await CNTXT.Set <F>().ToListAsync();

                return(GetEntities);
            }
        }
Exemple #2
0
        public async Task <F> Create(F entity)
        {
            using (StockTraderDbContext CNTXT = _STDBCF.CreateDbContext())
            {
                var CreatedEntity = await CNTXT.Set <F>().AddAsync(entity);

                await CNTXT.SaveChangesAsync();

                return(CreatedEntity.Entity);
            }
        }
Exemple #3
0
        public async Task <IEnumerable <Account> > GetAll()
        {
            using (StockTraderDbContext CNTXT = _STDBCF.CreateDbContext())
            {
                IEnumerable <Account> GetEntities = await CNTXT.Accounts
                                                    .Include(f => f.WhichUser)
                                                    .Include(f => f.AssetTransactions)
                                                    .ToListAsync();

                return(GetEntities);
            }
        }