Beispiel #1
0
        public IList<ImageWebResult> ExecuteQuery(string query)
        {
            var webResults = new List<ImageWebResult>();
            try
            {
                //URL Base:
                Uri urlBase = new Uri("https://api.datamarket.azure.com");

                //Make the system recognizes your account key:
                var dsc = new System.Data.Services.Client.DataServiceContext(urlBase);
                dsc.Credentials = new NetworkCredential(accountKey_jug, accountKey_jug);

                //Executes the query:
                string searchUri = this.CreateUrl(query);
                Uri urlSearch = new Uri(searchUri);
                dsc.IgnoreMissingProperties = true;
                webResults = dsc.Execute<ImageWebResult>(urlSearch).ToList<ImageWebResult>();
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.ToString());
            }

            return webResults;
        }
 public DataServiceCollection(System.Data.Services.Client.DataServiceContext context, string entitySetName, System.Func <System.Data.Services.Client.EntityChangedParams, bool> entityChangedCallback, System.Func <System.Data.Services.Client.EntityCollectionChangedParams, bool> collectionChangedCallback)
 {
 }
 public DataServiceCollection(System.Data.Services.Client.DataServiceContext context, System.Collections.Generic.IEnumerable <T> items, System.Data.Services.Client.TrackingMode trackingMode, string entitySetName, System.Func <System.Data.Services.Client.EntityChangedParams, bool> entityChangedCallback, System.Func <System.Data.Services.Client.EntityCollectionChangedParams, bool> collectionChangedCallback)
 {
 }
 public DataServiceCollection(System.Data.Services.Client.DataServiceContext context)
 {
 }