/// <summary>
        /// Initializes a new instance of the <see cref="DynamicContentClient" /> class.
        /// </summary>
        /// <param name="contentRepository">The content repository.</param>
        /// <param name="service">The service.</param>
        /// <param name="customerSession">The customer session.</param>
        /// <param name="cacheRepository">The cache repository.</param>
        public DynamicContentClient(IDynamicContentRepository contentRepository, IDynamicContentService service, ICustomerSessionService customerSession, ICacheRepository cacheRepository)
        {
		    _cacheRepository = cacheRepository;
            _customerSession = customerSession;
            _service = service;
            _isEnabled = DynamicContentConfiguration.Instance.Cache.IsEnabled;
        }
        public DynamicContentEvaluator(IDynamicContentRepository repository, IEvaluationPolicy[] policies, ICacheRepository cache)
            : base(cache)
        {
            _repository = repository;
            _policies   = policies;

            IsEnabled = DynamicContentConfiguration.Instance != null && DynamicContentConfiguration.Instance.Cache.IsEnabled;
        }
        public DynamicContentEvaluator(IDynamicContentRepository repository, IEvaluationPolicy[] policies, ICacheRepository cache)
            : base(cache)
        {
            _repository = repository;
            _policies = policies;

            IsEnabled = DynamicContentConfiguration.Instance != null && DynamicContentConfiguration.Instance.Cache.IsEnabled;

        }
Esempio n. 4
0
        public void Duplicate(IDynamicContentRepository repository)
        {
            var original = repository.Items.Expand(x => x.PropertyValues).ToArray()
                           .FirstOrDefault(x => x.DynamicContentItemId == InnerItem.DynamicContentItemId);
            var item = original.DeepClone(EntityFactory as IKnownSerializationTypes);

            item.DynamicContentItemId = item.GenerateNewKey();
            item.Name = item.Name + "_1";

            item.PropertyValues.ToList().ForEach(x =>
            {
                x.DynamicContentItemId = item.DynamicContentItemId;
                x.PropertyValueId      = x.GenerateNewKey();
            });

            repository.Add(item);
        }
 public DynamicContentService(IDynamicContentRepository repository, IDynamicContentEvaluator evaluator)
 {
     _repository = repository;
     _evaluator  = evaluator;
 }
		public DynamicContentService(IDynamicContentRepository repository, IDynamicContentEvaluator evaluator)
		{
			_repository = repository;
			_evaluator = evaluator;
		}
		private void RefreshRepository(ref IDynamicContentRepository client)
		{
			client.Dispose();
			client = null;
			GC.Collect();
			client = GetRepository();
		}