Bug 41071 - System.NotSupportedException: Specified method is not supported exception throws while using DataServiceQuery
Summary: System.NotSupportedException: Specified method is not supported exception thr...
Status: RESOLVED INVALID
Alias: None
Product: Forms
Classification: Xamarin
Component: Android ()
Version: unspecified
Hardware: PC Windows
: --- normal
Target Milestone: ---
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2016-05-13 07:17 UTC by Akila
Modified: 2016-07-04 10:09 UTC (History)
2 users (show)

Tags:
Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED INVALID

Description Akila 2016-05-13 07:17:36 UTC
I need to display the data via service reference and data queried using DataServiceQuery . 

Here code example i have used in my application. 

public class ViewModel : INotifyPropertyChanged
    {
        #region Members

        NorthwindEntities northwindEntity;

        #endregion

        #region Properties

        private List<Order> gridSource;
        public List<Order> GridSource
        {
            get { return gridSource; }
            set { gridSource = value; RaisePropertyChanged("GridSource"); }
        }

        #endregion

        #region Ctor

        public ViewModel()
        {
            gridSource = new List<Order>();
            try
            {
                LoadData();

            }
            catch (Exception e)
            {
                throw e;
            }
        }

        #endregion

        #region Methods

        async void LoadData()
        {
            string uri = "http://services.odata.org/Northwind/Northwind.svc/";
            var re = await CheckConnection(uri);
            if (re.StatusCode == HttpStatusCode.OK)
            {

                northwindEntity = new NorthwindEntities(new Uri(uri));
                DataServiceQuery query1 = (DataServiceQuery)northwindEntity.Orders;
                //query1.BeginExecute();
                DataServiceQuery<Order> query = northwindEntity.Orders.Expand("Customer");
                query = query.Skip<Order>(1).Take<Order>(50) as DataServiceQuery<Order>;
                IAsyncResult ar = query.BeginExecute(null, null);
                var items = query.EndExecute(ar);
                gridSource = items.ToList() as List<Order>;

            }
        }


        private async Task<HttpWebResponse> CheckConnection(String URL)
        {

            HttpWebRequest req = (HttpWebRequest)WebRequest.Create(URL);
            var response = (HttpWebResponse)await req.GetResponseAsync().ConfigureAwait(false);
            return response;

        }

        #endregion

        #region INotifyPropertyChanged Member

        public event PropertyChangedEventHandler PropertyChanged;

        void RaisePropertyChanged(string propertyName)
        {
            if (PropertyChanged != null)
            {
                PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
            }
        }

        #endregion
    }
Comment 1 Rui Marinho 2016-07-04 10:09:29 UTC
Hello this doesn't seem related with Xamarin.Forms. 

Thanks