예제 #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;
        }
예제 #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);
        }
예제 #4
0
 /// <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);
 }
예제 #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);
        }
예제 #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 }));
 }
예제 #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);
 }
예제 #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);
        }
예제 #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();
 }
예제 #12
0
 /// <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();
 }