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