示例#1
0
		 public async Task CreateOrEdit(CreateOrEditTestEntityDto input)
         {
            if(input.Id == null){
				await Create(input);
			}
			else{
				await Update(input);
			}
         }
示例#2
0
		 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);
         }
示例#3
0
		 protected virtual async Task Update(CreateOrEditTestEntityDto input)
         {
            var testEntity = await _testEntityRepository.FirstOrDefaultAsync((int)input.Id);
             ObjectMapper.Map(input, testEntity);
         }