예제 #1
0
        public virtual void Add(DynamicProperty dynamicProperty)
        {
            CheckDynamicProperty(dynamicProperty);

            using (var uow = _unitOfWorkManager.Begin(TransactionScopeOption.RequiresNew))
            {
                _dynamicPropertyStore.Add(dynamicProperty);
                uow.Complete();
            }

            DynamicPropertyCache.Set(dynamicProperty.Id, dynamicProperty);
        }
예제 #2
0
        protected DynamicProperty CreateAndGetDynamicPropertyWithTestPermission()
        {
            var dynamicProperty = new DynamicProperty()
            {
                InputType    = GetRandomAllowedInputType(),
                PropertyName = "City" + Guid.NewGuid().ToString().Substring(0, 5),
                Permission   = TestPermission,
                TenantId     = AbpSession.TenantId
            };

            WithUnitOfWork(() => { DynamicPropertyStore.Add(dynamicProperty); });

            return(dynamicProperty);
        }
        public virtual DynamicProperty Add(DynamicProperty dynamicProperty)
        {
            CheckDynamicProperty(dynamicProperty);

            using (var uow = _unitOfWorkManager.Begin(TransactionScopeOption.RequiresNew))
            {
                _dynamicPropertyStore.Add(dynamicProperty);
                uow.Complete();
            }

            var cacheKey = GetCacheKey(dynamicProperty.Id, dynamicProperty.TenantId);

            DynamicPropertyCache.Set(cacheKey, dynamicProperty);

            return(dynamicProperty);
        }
        protected DynamicProperty CreateAndGetDynamicPropertyWithTestPermission()
        {
            var rnd = new Random();

            string propertyNameRandomAppender = rnd.Next().ToString();

            Thread.Sleep(100);
            propertyNameRandomAppender += rnd.Next().ToString();

            var dynamicProperty = new DynamicProperty()
            {
                InputType    = GetRandomAllowedInputType(),
                PropertyName = "City" + propertyNameRandomAppender,
                Permission   = TestPermission,
                TenantId     = AbpSession.TenantId
            };

            WithUnitOfWork(() => { DynamicPropertyStore.Add(dynamicProperty); });

            return(dynamicProperty);
        }