public async Task CreateOrEdit(CreateOrEditAttachmentDto input)
 {
     if (input.Id == null)
     {
         await Create(input);
     }
     else
     {
         await Update(input);
     }
 }
        protected virtual async Task Create(CreateOrEditAttachmentDto input)
        {
            var attachment = ObjectMapper.Map <Attachment>(input);

            if (AbpSession.UserId != null)
            {
                attachment.UploadedBy = (int?)AbpSession.UserId;
            }

            if (AbpSession.TenantId != null)
            {
                attachment.TenantId = (int?)AbpSession.TenantId;
            }

            await _attachmentRepository.InsertAsync(attachment);
        }
        protected virtual async Task Update(CreateOrEditAttachmentDto input)
        {
            var attachment = await _attachmentRepository.FirstOrDefaultAsync((int)input.Id);

            ObjectMapper.Map(input, attachment);
        }