Ejemplo n.º 1
0
        public virtual SkipTakeClause Clone(CloneContext cloneContext)
        {
            LinqUtility.CheckNotNull("cloneContext", cloneContext);

            var clone = new SkipTakeClause(SkipCount, TakeCount);

            return(clone);
        }
        protected override void ApplyNodeSpecificSemantics(QueryModel queryModel, ClauseGenerationContext clauseGenerationContext)
        {
            LinqUtility.CheckNotNull("queryModel", queryModel);

            var            lastClause     = queryModel.BodyClauses.LastOrDefault();
            SkipTakeClause skipTakeClause = lastClause as SkipTakeClause;

            if (skipTakeClause != null)
            {
                skipTakeClause.TakeCount = Count;
            }
            else
            {
                queryModel.BodyClauses.Add(new SkipTakeClause(null, Count));
            }
        }