示例#1
0
        /// <summary>
        /// Initialize a new instance of <see cref="SkipQueryOption"/> based on the raw $skiptoken value and
        /// an EdmModel from <see cref="ODataQueryContext"/>.
        /// </summary>
        /// <param name="rawValue">The raw value for $skiptoken query.</param>
        /// <param name="context">The <see cref="ODataQueryContext"/> which contains the <see cref="IEdmModel"/> and some type information.</param>
        public SkipTokenQueryOption(string rawValue, ODataQueryContext context)
        {
            if (string.IsNullOrEmpty(rawValue))
            {
                throw Error.ArgumentNullOrEmpty(nameof(rawValue));
            }

            if (context == null)
            {
                throw Error.ArgumentNull(nameof(context));
            }

            RawValue  = rawValue;
            Validator = SkipTokenQueryValidator.GetSkipTokenQueryValidator(context);
            Handler   = context.GetSkipTokenHandler();
            Context   = context;
        }