예제 #1
0
        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);
            });
        }
예제 #2
0
 public async Task Update(DynamicParameterValueDto dto)
 {
     dto.TenantId = AbpSession.TenantId;
     await _dynamicParameterValueManager.UpdateAsync(ObjectMapper.Map <DynamicParameterValue>(dto));
 }