public async Task <List <YahooFinanceOptionEntityGroupByItem> > GetYahooFinanceOptionEntities(string ticker) { var query = await _stocksContext.Set <YahooFinanceOptionEntity>() .Where(tik => tik.Ticker == ticker) .GroupBy(c => new { c.Created.Date, c.Type, }, (k, g) => new { OpenInterest = g.Sum(b => b.OpenInterest), Created = k.Date, Type = k.Type }).Select(h => new YahooFinanceOptionEntityGroupByItem() { Created = h.Created, OpenInterest = h.OpenInterest, Type = h.Type }).ToListAsync(); return(query); }
public GenericRepository(StocksContext Context) { this.Context = Context; this.dbSet = Context.Set <T>(); }
public void AddRange(IEnumerable <T> entities) { Context.Set <T>().AddRange(entities); }
public GenericRepository(StocksContext context) { this.context = context; dbSet = context.Set <TEntity>(); }