internal DummyBuilder
 (
     IFlowQuery implementor,
     IImmediateFlowQuery <UserEntity> query)
     : base(implementor, query, JoinType.InnerJoin)
 {
 }
示例#2
0
        /// <summary>
        ///     Initializes a new instance of the <see cref="FetchBuilder{TQuery}" /> class.
        /// </summary>
        /// <param name="implementor">
        ///     The <see cref="FlowQueryBase{TSource, TQuery}" /> query that creates this
        ///     <see cref="FetchBuilder{TQuery}" /> instance.
        /// </param>
        /// <param name="query">
        ///     The <see cref="IFlowQuery{TSource, TQuery}" /> query that creates this
        ///     <see cref="FetchBuilder{TQuery}" /> instance.
        /// </param>
        /// <param name="path">
        ///     The association path used for the fetching strategy this <see cref="FetchBuilder{TQuery}" /> instance
        ///     should represent.
        /// </param>
        /// <param name="alias">
        ///     The alias used for the fetching strategy this <see cref="FetchBuilder{TQuery}" /> instance
        ///     should represent.
        /// </param>
        /// <exception cref="ArgumentException">
        ///     <paramref name="implementor" /> and <paramref name="query" /> are not the same object reference.
        /// </exception>
        public FetchBuilder(IFlowQuery implementor, TQuery query, string path, string alias)
        {
            if (!ReferenceEquals(implementor, query))
            {
                throw new ArgumentException("|implementor| and |query| must be the same object reference.");
            }

            _implementor = implementor;
            _query       = query;
            _path        = path;
            _alias       = alias;
        }
        /// <summary>
        ///     Initializes a new instance of the <see cref="FlowQueryBase{TSource,TQuery}" /> class.
        /// </summary>
        /// <param name="criteriaFactory">
        ///     The criteria factory.
        /// </param>
        /// <param name="alias">
        ///     The alias.
        /// </param>
        /// <param name="options">
        ///     The options.
        /// </param>
        /// <param name="query">
        ///     The query.
        /// </param>
        /// <exception cref="ArgumentException">
        ///     The "this" reference is not of the type <see cref="T:TQuery" /> as specified by
        ///     <typeparamref name="TQuery" />.
        /// </exception>
        /// <exception cref="ArgumentNullException">
        ///     <paramref name="criteriaFactory" /> is null and the specific query alteration is not an implementation
        ///     of <see cref="T:IDetachedFlowQuery{TSource}" />.
        /// </exception>
        protected internal FlowQueryBase
        (
            Func <Type, string, ICriteria> criteriaFactory,
            string alias             = null,
            FlowQueryOptions options = null,
            IFlowQuery query         = null
        )
            : base(alias, query)
        {
            if (criteriaFactory == null)
            {
                // TODO: To allow for extensions the null-check should perhaps be pushed down the inheritance chain?
                // allow criteria factory to be null for detached queries.
                if (!(this is IDetachedFlowQuery <TSource>))
                {
                    throw new ArgumentNullException("criteriaFactory");
                }
            }

            if (query != null)
            {
                CacheMode   = query.CacheMode;
                CacheRegion = query.CacheRegion;
                IsCacheable = query.IsCacheable;
                Fetches     = query.Fetches.ToList();
                GroupBys    = query.GroupBys.ToList();
                Locks       = query.Locks.ToList();
                Orders      = query.Orders.ToList();

                ResultsToSkip = query.ResultsToSkip;
                ResultsToTake = query.ResultsToTake;
            }
            else
            {
                Fetches  = new List <Fetch>();
                GroupBys = new List <FqGroupByProjection>();
                Locks    = new List <Lock>();
                Orders   = new List <OrderByStatement>();
            }

            CriteriaFactory = criteriaFactory;

            Options = options;
        }
示例#4
0
 /// <summary>
 ///     Initializes a new instance of the <see cref="LockBuilder{TQuery}" /> class.
 /// </summary>
 /// <param name="implementor">
 ///     The query instance.
 /// </param>
 /// <param name="query">
 ///     The query instance again.
 /// </param>
 /// <param name="alias">
 ///     The alias.
 /// </param>
 public LockBuilder(IFlowQuery implementor, TQuery query, string alias)
 {
     _implementor = implementor;
     _query       = query;
     _alias       = alias;
 }