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