public async Task CreateOrEdit(CreateOrEditAssetNotesDto input) { if (input.Id == null) { await Create(input); } else { await Update(input); } }
protected virtual async Task Create(CreateOrEditAssetNotesDto input) { var assetNotes = ObjectMapper.Map <AssetNote>(input); if (AbpSession != null) { assetNotes.TenantId = (int?)AbpSession.TenantId; assetNotes.UserId = AbpSession?.UserId; } await _assetNotesRepository.InsertAsync(assetNotes); }
protected virtual async Task Update(CreateOrEditAssetNotesDto input) { var assetNotes = await _assetNotesRepository.FirstOrDefaultAsync((int)input.Id); ObjectMapper.Map(input, assetNotes); }