public async Task <T> AddAsync(T entity) { await _dbContext.Set <T>().AddAsync(entity); await _dbContext.SaveChangesAsync(); return(entity); }
public async Task <int> ListPost(IEnumerable <CustomerSupplied> entity) { try { await _dbContext.CustomerSupplied.AddRangeAsync(entity); return(await _dbContext.SaveChangesAsync()); } catch (Exception e) { Console.WriteLine(e); throw; } }
public async Task <int> ListPost(IEnumerable <DailyExpense> dto) { try { await _dbContext.DailyExpense.AddRangeAsync(dto); return(await _dbContext.SaveChangesAsync()); } catch (Exception e) { Console.WriteLine(e); throw; } }