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