示例#1
0
        /// <summary>
        /// 编辑Employee
        /// </summary>
        //[AbpAuthorize(EmployeeAppPermissions.Employee_EditEmployee)]
        protected virtual async Task UpdateEmployeeAsync(EmployeeEditDto input)
        {
            //TODO:更新前的逻辑判断,是否允许更新
            var entity = await _employeeRepository.GetAsync(input.Id.Value);

            input.MapTo(entity);

            // ObjectMapper.Map(input, entity);
            await _employeeRepository.UpdateAsync(entity);
        }
示例#2
0
        /// <summary>
        /// 新增Employee
        /// </summary>

        protected virtual async Task <EmployeeEditDto> CreateAsync(EmployeeEditDto input)
        {
            //TODO:新增前的逻辑判断,是否允许新增

            // var entity = ObjectMapper.Map <Employee>(input);
            var entity = input.MapTo <Employee>();


            entity = await _entityRepository.InsertAsync(entity);

            return(entity.MapTo <EmployeeEditDto>());
        }