This is a migrated thread and some comments may be shown as answers.

Query Interceptors problem in ADO.NET Data Service

1 Answer 47 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Henk
Top achievements
Rank 1
Henk asked on 23 Feb 2010, 04:38 PM
Hello,

I have a problem using Query interceptors in a ADO.NET Data Service.
For the test I used the Silverlight integration sample application using the NorthWindOA database.
This is the code in the Silverlight application of the query of Orders and OrderDetails using Expand:
            // Create the Service class specifying the location of the ADO.NET Data Services   
            this.context = new OADataContext(new Uri("OADataService.svc", UriKind.Relative));  
 
            var Orders =  
                (from o  
                 in this.context.Orders.Expand("OrderDetails")  
                 select o  
                 ) as DataServiceQuery<Order>;  
 
            //use code block to perform the binding at the end of the async call  
            //casting the Customers to a LIST  
            Orders.BeginExecute(  
                (ar) => this.RadGridView1.ItemsSource = Orders.EndExecute(ar).ToList(), null); 
In the Data Service I implemented two Query interceptors for Orders and OrderDetails.
    [QueryInterceptor("Orders")]  
    public Expression<Func<Model.Order, bool>> OnQueryOrders()  
    {  
        return i => i.OrderID < 10255;  
    }  
 
    [QueryInterceptor("OrderDetails")]  
    public Expression<Func<Model.OrderDetail, bool>> OnQueryOrderDetails()  
    {  
        return i => i.OrderID < 10255;  
    } 
If I only implement the Query interceptor for Orders everything works ok.
If I add the Query interceptor for OrderDetails I get an Error:
System.Data.Services.Client.DataServiceQueryException was unhandled by user code  
  Message="An error occurred while processing this request." 
  StackTrace:  
       at System.Data.Services.Client.QueryAsyncResult.EndExecute[TElement](Object source, IAsyncResult asyncResult)  
       at System.Data.Services.Client.DataServiceQuery`1.EndExecute(IAsyncResult asyncResult)  
       at OASilverlightTestApp.Page.<>c__DisplayClass1.<.ctor>b__0(IAsyncResult ar)  
       at System.Data.Services.Client.BaseAsyncResult.HandleCompleted()  
       at System.Data.Services.Client.QueryAsyncResult.AsyncEndRead(IAsyncResult asyncResult)  
       at System.IO.Stream.BeginRead(Byte[] buffer, Int32 offset, Int32 count, AsyncCallback callback, Object state)  
       at System.Data.Services.Client.QueryAsyncResult.AsyncEndGetResponse(IAsyncResult asyncResult)  
  InnerException: System.InvalidOperationException  
       Message="An error occurred while saving changes. See the inner exception for details." 
       StackTrace:  
            at System.Data.Services.Client.BaseAsyncResult.EndExecute[T](Object source, String method, IAsyncResult asyncResult)  
            at System.Data.Services.Client.QueryAsyncResult.EndExecute[TElement](Object source, IAsyncResult asyncResult)  
       InnerException: System.Data.Services.Client.DataServiceClientException  
            Message="<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"yes\"?>\r\n<error xmlns=\"http://schemas.microsoft.com/ado/2007/08/dataservices/metadata\">\r\n  <code></code>\r\n  <message xml:lang=\"nl-NL\">Not Implemented</message>\r\n</error>"  
            StatusCode=501  
            InnerException: 
Is this error related to OA or ADO.NET Data Services?


1 Answer, 1 is accepted

Sort by
0
PetarP
Telerik team
answered on 01 Mar 2010, 12:51 PM
Hello Henk,

We tested the behavior you described using our latest code base and everything worked fine. Since we are targeting great improvements in our LINQ implementation I believe that with the Q1 release you will not be seeing this problem. The Q1 release is scheduled for the next week.

Best wishes,
Petar
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Tags
General Discussions
Asked by
Henk
Top achievements
Rank 1
Answers by
PetarP
Telerik team
Share this question
or