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