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