Esempio n. 1
0
        /// <inheritdoc/>
        public async Task <EmployeeItem> CreateEmployeeAsync(UpdateEmployeeRequest createRequest)
        {
            var dbEmployee = Mapper.Map <UpdateEmployeeRequest, Employee>(createRequest);

            await _repository.CreateAsync(dbEmployee);

            return(Mapper.Map <EmployeeItem>(dbEmployee));
        }
Esempio n. 2
0
        /// <inheritdoc/>
        public async Task <EmployeeItem> UpdateEmployeeAsync(int employeeId, UpdateEmployeeRequest updateRequest)
        {
            var dbEmployee = await _repository.UpdateAsync(employeeId, Mapper.Map <Employee>(updateRequest));

            return(Mapper.Map <EmployeeItem>(dbEmployee));
        }