예제 #1
0
        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;
            }
        }
예제 #3
0
        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;
            }
        }