コード例 #1
0
        /// <summary>
        /// 编辑名片
        /// </summary>
        public virtual async Task UpdateBusinessCardAsync(BusinessCardEditDto input)
        {
            //TODO:更新前的逻辑判断,是否允许更新

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

            input.MapTo(entity);

            await _businessCardRepository.UpdateAsync(entity);
        }
コード例 #2
0
        /// <summary>
        /// 新增名片
        /// </summary>
        public virtual async Task <BusinessCardEditDto> CreateBusinessCardAsync(BusinessCardEditDto input)
        {
            //TODO:新增前的逻辑判断,是否允许新增

            var entity = input.MapTo <BusinessCard>();

            entity = await _businessCardRepository.InsertAsync(entity);

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