Beispiel #1
0
        public async Task updateAccountInfo(int id, NewWorkerDto workerDto)
        {
            var user = await getEmployee(id);

            _workers.Attach(user);
            workerDto.MapToWorker(user);
            await _context.SaveChangesAsync();
        }
Beispiel #2
0
        public async Task <int> createNewEmployee(NewWorkerDto workerDto)
        {
            var userEntity = workerDto.MapToWorker(new Worker());

            _workers.Add(userEntity);
            await _context.SaveChangesAsync();

            return(userEntity.Id);
        }