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