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