Пример #1
0
        /// <summary>
        /// Sets the row offset and size values for the entity set. TODO: Examine for changing to private.
        /// </summary>
        /// <param name="subset">
        /// The subset of rows to return.
        /// </param>
        /// <exception cref="ArgumentNullException">
        /// <paramref name="subset"/> is null.
        /// </exception>
        protected void SetOffsetAndSize([NotNull] Subset subset)
        {
            if (subset == null)
            {
                throw new ArgumentNullException(nameof(subset));
            }

            this.Page.RowOffset = subset.Page.RowOffset;
            this.Page.Size      = subset.Page.Size;
        }
Пример #2
0
        /// <summary>
        /// Seeks a subset of results from the matching result set.
        /// </summary>
        /// <param name="limit">
        /// The result set limits to apply.
        /// </param>
        /// <returns>
        /// The current <see cref="EntitySet{T}"/>.
        /// </returns>
        /// <exception cref="ArgumentNullException">
        /// <paramref name="limit"/> is null.
        /// </exception>
        public EntitySet <T> Seek([NotNull] Action <Subset> limit)
        {
            if (limit == null)
            {
                throw new ArgumentNullException(nameof(limit));
            }

            var subset = new Subset();

            limit.Invoke(subset);
            this.SetOffsetAndSize(subset);
            return(this);
        }