The following code throws an exception which I have no idea what goes wrong , can anyone shed some light on this one please?
RestAPIDataContext ctx = GetContext();
var songsQuery = (from item in ctx.Songs
where item.Artist.Title == "George Michael"
select item) as DataServiceQuery<SongsItem>;
songsQuery.BeginExecute(
(IAsyncResult asyncResult) => Dispatcher.BeginInvoke(() =>
{
songsList.ItemsSource = songsQuery.EndExecute(asyncResult);
}), songsQuery
);
private static RestAPIDataContext GetContext()
{
RestAPIDataContext ctx =
new RestAPIDataContext(
new Uri("http://win-oirj50igics/restapi/_vti_bin/ListData.svc"));
return ctx;
}
System.Data.Services.Client.DataServiceQueryException: An error occurred while processing this request. ---> System.InvalidOperationException: An error occurred while saving changes. See the inner exception for details. ---> System.Data.Services.Client.DataServiceClientException:
Request version '1.0' is too low for the response. The lowest supported version is '2.0'.
--- End of inner exception stack trace ---
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)
--- End of inner exception stack trace ---
at System.Data.Services.Client.QueryAsyncResult.EndExecute[TElement](Object source, IAsyncResult asyncResult)
at System.Data.Services.Client.DataServiceQuery`1.EndExecute(IAsyncResult asyncResult)
at SLRest.MainPage.<>c_DisplayClass3.<>c_DisplayClass5.b__1()