Пример #1
0
        /// <summary>
        /// 编辑Attachment
        /// </summary>

        protected virtual async Task UpdateAttachmentAsync(AttachmentEditDto input)
        {
            //TODO:更新前的逻辑判断,是否允许更新
            var entity = await _attachmentRepository.GetAsync(input.Id.Value);

            input.MapTo(entity);

            // ObjectMapper.Map(input, entity);
            await _attachmentRepository.UpdateAsync(entity);
        }
Пример #2
0
        public void Save(AttachmentEditDto input)
        {
            var item = new Attachment();

            this._attachmentRepository.Insert(input.MapTo(item));
        }