public async Task CreateOrEdit(CreateOrEditAttachmentEntityTypeDto input) { if (input.Id == null) { await Create(input); } else { await Update(input); } }
protected virtual async Task Create(CreateOrEditAttachmentEntityTypeDto input) { var attachmentEntityType = ObjectMapper.Map <AttachmentEntityType>(input); if (AbpSession.TenantId != null) { attachmentEntityType.TenantId = (int?)AbpSession.TenantId; } await _attachmentEntityTypeRepository.InsertAsync(attachmentEntityType); }
protected virtual async Task Update(CreateOrEditAttachmentEntityTypeDto input) { var attachmentEntityType = await _attachmentEntityTypeRepository.FirstOrDefaultAsync((int)input.Id); ObjectMapper.Map(input, attachmentEntityType); }