Пример #1
0
        /// <summary>
        /// 编辑用户等级表
        /// </summary>
        public virtual async Task UpdateUserRankAsync(UserRankEditDto input)
        {
            //TODO:更新前的逻辑判断,是否允许更新

            var entity = await _userRankRepository.GetAsync(input.Id.Value);

            entity = ObjectMapper.Map <UserRank>(input);

            await _userRankRepository.UpdateAsync(entity);
        }
Пример #2
0
        /// <summary>
        /// 新增用户等级表
        /// </summary>
        public virtual async Task <UserRankEditDto> CreateUserRankAsync(UserRankEditDto input)
        {
            //TODO:新增前的逻辑判断,是否允许新增

            var entity = ObjectMapper.Map <UserRank>(input);

            entity = await _userRankRepository.InsertAsync(entity);

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