예제 #1
0
        /// <summary>
        /// Creates a data service query for data of a specified generic type.
        /// create a query based on (BaseUri + relativeUri)
        /// </summary>
        /// <typeparam name="TIinterface">The exposed interface type of elements returned by the query.</typeparam>
        /// <typeparam name="TData">The type used by the query internaly.</typeparam>
        /// <param name="entitySetName">A string that resolves to a URI.</param>
        /// <returns>A new System.Data.Services.Client.DataServiceQuery<TElement> instance that represents a data service query.</returns>
        public IQueryable <TIinterface> CreateQuery <TIinterface, TData>(string entitySetName)
        {
            IQueryable <TIinterface> inner = (IQueryable <TIinterface>)_dataContext.CreateQuery <TData>(entitySetName);
            var result = new MediaQueryable <TIinterface, TData>(inner, _queryRetryPolicy);

            return(result);
        }
        /// <summary>
        /// Creates a data service query for data of a specified generic type.
        /// create a query based on (BaseUri + relativeUri)
        /// </summary>
        /// <typeparam name="TIinterface">The exposed interface type of elements returned by the query.</typeparam>
        /// <typeparam name="TData">The type used by the query internaly.</typeparam>
        /// <param name="entitySetName">A string that resolves to a URI.</param>
        /// <returns>A new System.Data.Services.Client.DataServiceQuery<TElement> instance that represents a data service query.</returns>
        public IQueryable <TIinterface> CreateQuery <TIinterface, TData>(string entitySetName)
        {
            _clientRequestIdAdapter.ChangeCurrentRequestId();
            IQueryable <TIinterface> inner = (IQueryable <TIinterface>)_dataContext.CreateQuery <TData>(entitySetName);
            var result = new MediaQueryable <TIinterface, TData>(inner, _queryRetryPolicy);

            return(result);
        }