Exemplo n.º 1
0
        /// <summary>
        /// 编辑分享
        /// </summary>
        protected virtual async Task UpdateShareAsync(ShareEditDto input)
        {
            var entity = await _shareRepository.GetAsync(input.Id.Value);

            input.MapTo(entity);
            await _shareRepository.UpdateAsync(entity);
        }
Exemplo n.º 2
0
        /// <summary>
        /// 新增分享
        /// </summary>
        protected virtual async Task <ShareEditDto> CreateShareAsync(ShareEditDto input)
        {
            var entity = input.MapTo <Share>();

            entity = await _shareRepository.InsertAsync(entity);

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