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