Example #1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="ProxyQueryManagerBase"/> class.
        /// </summary>
        /// <param name="merchelloContext">
        /// The <see cref="IMerchelloContext"/>.
        /// </param>
        /// <param name="queryManager">
        /// The <see cref="IProxyQueryManager"/>.
        /// </param>
        protected ProxyQueryManagerBase(IMerchelloContext merchelloContext, IProxyQueryManager queryManager)
        {
            Ensure.ParameterNotNull(merchelloContext, "MerchelloContext cannot be null");
            Ensure.ParameterNotNull(queryManager, "The IProxyEntityServiceResolver was null.");

            this.Services     = merchelloContext.Services;
            this.QueryManager = queryManager;
            this.Cache        = merchelloContext.Cache.RequestCache;
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="ProxyQueryManagerBase"/> class.
        /// </summary>
        /// <param name="merchelloContext">
        /// The <see cref="IMerchelloContext"/>.
        /// </param>
        /// <param name="queryManager">
        /// The <see cref="IProxyQueryManager"/>.
        /// </param>
        protected ProxyQueryManagerBase(IMerchelloContext merchelloContext, IProxyQueryManager queryManager)
        {
            Ensure.ParameterNotNull(merchelloContext, "MerchelloContext cannot be null");
            Ensure.ParameterNotNull(queryManager, "The IProxyEntityServiceResolver was null.");

            this.Services = merchelloContext.Services;
            this.QueryManager = queryManager;
            this.Cache = merchelloContext.Cache.RequestCache;
        }
Example #3
0
        /// <summary>
        /// Initializes a new instance of the <see cref="MerchelloHelper"/> class.
        /// </summary>
        /// <param name="merchelloContext">
        /// The merchello context.
        /// </param>
        /// <param name="enableDataModifiers">
        /// The enable data modifiers.
        /// </param>
        /// <param name="conversionType">
        /// The conversion type.
        /// </param>
        /// <param name="queryManager">
        /// The proxy service resolver.
        /// </param>
        /// <param name="collectionProviderResolver">
        /// The <see cref="IEntityCollectionProviderResolver"/>
        /// </param>
        internal MerchelloHelper(
            IMerchelloContext merchelloContext,
            bool enableDataModifiers,
            DetachedValuesConversionType conversionType,
            IProxyQueryManager queryManager,
            IEntityCollectionProviderResolver collectionProviderResolver)
        {
            Ensure.ParameterNotNull(merchelloContext, "ServiceContext cannot be null");
            Ensure.ParameterNotNull(queryManager, "The query manager was null");
            Ensure.ParameterNotNull(collectionProviderResolver, "The IEntityCollectionProviderResolver was null");
            _enableDataModifiers = enableDataModifiers;
            _queryProvider       = new Lazy <ICachedQueryProvider>(() => new CachedQueryProvider(merchelloContext, _enableDataModifiers, conversionType));
            _validationHelper    = new Lazy <IValidationHelper>(() => new ValidationHelper());

            this.Initialize(merchelloContext, queryManager, collectionProviderResolver);
        }
 /// <summary>
 /// Initializes a new instance of the <see cref="FilterGroupManager"/> class.
 /// </summary>
 /// <param name="merchelloContext">
 /// The <see cref="IMerchelloContext"/>.
 /// </param>
 /// <param name="queryManager">
 /// The <see cref="IProxyQueryManager"/>.
 /// </param>
 /// <param name="collectionProviderResolver">
 /// The <see cref="IEntityCollectionProviderResolver"/>.
 /// </param>
 public FilterGroupManager(IMerchelloContext merchelloContext, IProxyQueryManager queryManager, IEntityCollectionProviderResolver collectionProviderResolver)
     : base(merchelloContext, queryManager)
 {
     Ensure.ParameterNotNull(collectionProviderResolver, "The IEntityCollectionProviderResolver was null");
     this.Initialize(merchelloContext, collectionProviderResolver);
 }
Example #5
0
        /// <summary>
        /// Initializes the MerchelloHelper.
        /// </summary>
        /// <param name="merchelloContext">
        /// The merchello context.
        /// </param>
        /// <param name="queryManager">
        /// The resolver.
        /// </param>
        /// <param name="collectionProviderResolver">
        /// The collection Provider Resolver.
        /// </param>
        private void Initialize(IMerchelloContext merchelloContext, IProxyQueryManager queryManager, IEntityCollectionProviderResolver collectionProviderResolver)
        {
            this.Collections = new CollectionManager(merchelloContext, queryManager);

            this.Filters = new FilterGroupManager(merchelloContext, queryManager, collectionProviderResolver);
        }
Example #6
0
 /// <summary>
 /// Gets an instance of the <see cref="IProductFilterGroupQuery"/>.
 /// </summary>
 /// <param name="manager">
 /// The manager.
 /// </param>
 /// <returns>
 /// The <see cref="IProductFilterGroupQuery"/>.
 /// </returns>
 public static IProductFilterGroupQuery FilterGroupQuery(this IProxyQueryManager manager)
 {
     return(manager.Instance <ProductFilterGroupQuery>(new object[] { MerchelloContext.Current }));
 }
Example #7
0
 /// <summary>
 /// Gets an instance of the <see cref="IProductCollectionQuery"/>.
 /// </summary>
 /// <param name="manager">
 /// The manager.
 /// </param>
 /// <returns>
 /// The <see cref="IProductCollectionQuery"/>.
 /// </returns>
 public static IProductCollectionQuery CollectionQuery(this IProxyQueryManager manager)
 {
     return(manager.Instance <ProductCollectionQuery>(new object[] { MerchelloContext.Current }));
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="FilterGroupManager"/> class.
 /// </summary>
 /// <param name="merchelloContext">
 /// The <see cref="IMerchelloContext"/>.
 /// </param>
 /// <param name="queryManager">
 /// The <see cref="IProxyQueryManager"/>.
 /// </param>
 /// <param name="collectionProviderResolver">
 /// The <see cref="IEntityCollectionProviderResolver"/>.
 /// </param>
 public FilterGroupManager(IMerchelloContext merchelloContext, IProxyQueryManager queryManager, IEntityCollectionProviderResolver collectionProviderResolver)
     : base(merchelloContext, queryManager)
 {
     Ensure.ParameterNotNull(collectionProviderResolver, "The IEntityCollectionProviderResolver was null");
     this.Initialize(merchelloContext, collectionProviderResolver);
 }
Example #9
0
        /// <summary>
        /// Initializes the MerchelloHelper.
        /// </summary>
        /// <param name="merchelloContext">
        /// The merchello context.
        /// </param>
        /// <param name="queryManager">
        /// The resolver.
        /// </param>
        /// <param name="collectionProviderResolver">
        /// The collection Provider Resolver.
        /// </param>
        private void Initialize(IMerchelloContext merchelloContext, IProxyQueryManager queryManager, IEntityCollectionProviderResolver collectionProviderResolver)
        {
            this.Collections = new CollectionManager(merchelloContext, queryManager);

            this.Filters = new FilterGroupManager(merchelloContext, queryManager, collectionProviderResolver);
        }
Example #10
0
        /// <summary>
        /// Initializes a new instance of the <see cref="MerchelloHelper"/> class.
        /// </summary>
        /// <param name="merchelloContext">
        /// The merchello context.
        /// </param>
        /// <param name="enableDataModifiers">
        /// The enable data modifiers.
        /// </param>
        /// <param name="conversionType">
        /// The conversion type.
        /// </param>
        /// <param name="queryManager">
        /// The proxy service resolver.
        /// </param>
        /// <param name="collectionProviderResolver">
        /// The <see cref="IEntityCollectionProviderResolver"/>
        /// </param>
        internal MerchelloHelper(
            IMerchelloContext merchelloContext,
            bool enableDataModifiers,
            DetachedValuesConversionType conversionType,
            IProxyQueryManager queryManager,
            IEntityCollectionProviderResolver collectionProviderResolver)
        {
            Ensure.ParameterNotNull(merchelloContext, "ServiceContext cannot be null");
            Ensure.ParameterNotNull(queryManager, "The query manager was null");
            Ensure.ParameterNotNull(collectionProviderResolver, "The IEntityCollectionProviderResolver was null");
            _enableDataModifiers = enableDataModifiers;
            _queryProvider = new Lazy<ICachedQueryProvider>(() => new CachedQueryProvider(merchelloContext, _enableDataModifiers, conversionType));
            _validationHelper = new Lazy<IValidationHelper>(() => new ValidationHelper());

            this.Initialize(merchelloContext, queryManager, collectionProviderResolver);
        }
 /// <summary>
 /// Initializes a new instance of the <see cref="CollectionManager"/> class.
 /// </summary>
 /// <param name="merchelloContext">
 /// The <see cref="IMerchelloContext"/>
 /// </param>
 /// <param name="queryManager">
 /// The resolver.
 /// </param>
 public CollectionManager(IMerchelloContext merchelloContext, IProxyQueryManager queryManager)
     : base(merchelloContext, queryManager)
 {
     this.Initialize();
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="CollectionManager"/> class.
 /// </summary>
 /// <param name="merchelloContext">
 /// The <see cref="IMerchelloContext"/>
 /// </param>
 /// <param name="queryManager">
 /// The resolver.
 /// </param>
 public CollectionManager(IMerchelloContext merchelloContext, IProxyQueryManager queryManager)
     : base(merchelloContext, queryManager)
 {
     this.Initialize();
 }