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