public async Task CreateAsync(T item) { using (var _ctx = new MarketAnalyzerDBContext()) { await _context.Set <T>().AddAsync(item); await _context.SaveChangesAsync(); } }
public List <T> List() { using (var _context = new MarketAnalyzerDBContext()) { return(_context.Set <T>().ToList()); } }
public async Task <List <T> > ListAsync() { using (var _context = new MarketAnalyzerDBContext()) { return(await _context.Set <T>().ToListAsync()); } }
public void Create(T item) { using (var _context = new MarketAnalyzerDBContext()) { _context.Set <T>().Add(item); _context.SaveChanges(); } }