public async Task <Employee> AddAsync(Employee employee)
        {
            var result = await _context.AddAsync <Employee>(employee);

            await _context.SaveChangesAsync();

            return(result.Entity);
        }
        public async Task <IEnumerable <Dependent> > UpsertAsync(ICollection <Dependent> dependents)
        {
            await _context.AddRangeAsync(dependents.Where(x => x.Id == 0));

            _context.UpdateRange(dependents.Where(x => x.Id > 0));
            await _context.SaveChangesAsync();

            return(dependents);
        }
Ejemplo n.º 3
0
        public async Task AddAsync(Employee model)
        {
            _context.Employees.Add(model);

            await _context.SaveChangesAsync().ConfigureAwait(false);
        }
Ejemplo n.º 4
0
        public async Task AddAsync(Dependent model)
        {
            _context.Dependents.Add(model);

            await _context.SaveChangesAsync().ConfigureAwait(false);
        }