public async Task Should_Update_Value_Async() { var dynamicParameter = CreateAndGetDynamicParameterWithTestPermission(); var dynamicParameterValue = new DynamicParameterValue() { DynamicParameterId = dynamicParameter.Id, Value = "Test", TenantId = AbpSession.TenantId }; await WithUnitOfWorkAsync(async() => { await _dynamicParameterValueManager.AddAsync(dynamicParameterValue); }); await WithUnitOfWorkAsync(async() => { dynamicParameterValue = await _dynamicParameterValueManager.GetAsync(dynamicParameterValue.Id); dynamicParameterValue.ShouldNotBeNull(); }); dynamicParameterValue.Value = "Test2"; await RunAndCheckIfPermissionControlledAsync(async() => { await _dynamicParameterValueManager.UpdateAsync(dynamicParameterValue); }); await WithUnitOfWorkAsync(async() => { var entity = await _dynamicParameterValueManager.GetAsync(dynamicParameterValue.Id); entity.Value.ShouldBe("Test2"); entity.DynamicParameterId.ShouldBe(dynamicParameter.Id); }); }
public async Task Update(DynamicParameterValueDto dto) { dto.TenantId = AbpSession.TenantId; await _dynamicParameterValueManager.UpdateAsync(ObjectMapper.Map <DynamicParameterValue>(dto)); }