Exemple #1
0
        private List <TableColumnsMetadataEntity> GetColumnsMetadata()
        {
            CloudTableClient    clientTable         = new CloudTableClient(_Account.TableEndpoint.ToString(), _Account.Credentials);
            TableServiceContext serviceContextTable = clientTable.GetDataServiceContext();

            string query = string.Format("TableColumnsMetadata?$filter=entityset eq '{0}'", EntitySet);
            List <TableColumnsMetadataEntity> resultsQuery = serviceContextTable.Execute <TableColumnsMetadataEntity>(new Uri(query, UriKind.Relative)).ToList();

            return(resultsQuery);
        }
        public static IEnumerable <TableEntity> Query(string account, string key, string table, string query)
        {
            //http://social.msdn.microsoft.com/Forums/en-US/windowsazure/thread/481afa1b-03a9-42d9-ae79-9d5dc33b9297/
            //http://stackoverflow.com/questions/2363399/problem-accesing-azure-table-entities/2370814#2370814
            //http://azuretablequery.codeplex.com/

            CloudTableClient    tableClient = Client.GetTableClient(account, key);
            TableServiceContext context     = tableClient.GetDataServiceContext();

            context.ReadingEntity += new EventHandler <ReadingWritingEntityEventArgs>(context_ReadingEntity);

            StringBuilder builder = new StringBuilder();

            Uri url = new Uri(string.Format("{0}{1}{2}", tableClient.BaseUri, table, string.IsNullOrEmpty(query) ? string.Empty : "?$filter=" + query));

            return(context.Execute <TableEntity>(url));
        }
        public static List <TableColumnsMetadataEntity> GetRdfMetadataColumnNamespace(string entitySet)
        {
            CloudTableClient tableClient = new CloudTableClient(s_account.TableEndpoint.ToString(), s_account.Credentials);

            TableServiceContext tableServiceContext = tableClient.GetDataServiceContext();

            string queryTemplate = "{0}?$filter=entityset eq '{1}'";

            string query = string.Format(queryTemplate, DataLoaderConstants.TableColumnsMetadataTableName, entitySet);
            List <TableColumnsMetadataEntity> resultsQuery = tableServiceContext.Execute <TableColumnsMetadataEntity>(new Uri(query, UriKind.Relative)).ToList();

            if (resultsQuery.Count > 0)
            {
                return(resultsQuery);
            }
            else
            {
                return(null);
            }
        }