示例#1
0
        /// <summary>
        /// Retrieves the data from Azure Storage using <see cref="Collection"/>.
        /// </summary>
        public virtual IEnumerable <TData> GetByKey()
        {
            // Create the table query.
            var rangeQuery = Collection.Where
                             (
                TableQuery.GenerateFilterCondition("PartitionKey", QueryComparisons.Equal, StorageStore <object, object> .GetSafeStorageKey(typeof(TCollectionItemData).FullName))
                             );

            return(ReadableSource.ExecuteQuery(rangeQuery));
        }
        /// <summary>
        /// Retrieves the data from Azure Storage using <see cref="TableStorageStore{TData,TCollectionItemData}.Collection"/>.
        /// </summary>
        public override IEnumerable <EntityTableEntity <TData> > GetByKey()
        {
            // Create the table query.
            var rangeQuery = Collection.Where
                             (
                TableQuery.GenerateFilterCondition("PartitionKey", QueryComparisons.Equal, StorageStore <object, object> .GetSafeStorageKey(typeof(TData).FullName))
                             );

            IEnumerable <EntityTableEntity <TData> > results = ReadableSource.ExecuteQuery(rangeQuery);

            return(results);
        }
示例#3
0
        /// <summary>
        /// Retrieves the data from Azure Storage using <see cref="Collection"/>.
        /// </summary>
        public virtual TData GetByKeyAndRow(Guid rsn)
        {
            // Create the table query.
            var rangeQuery = Collection.Where
                             (
                TableQuery.CombineFilters
                (
                    TableQuery.GenerateFilterCondition("PartitionKey", QueryComparisons.Equal, StorageStore <object, object> .GetSafeStorageKey(typeof(TCollectionItemData).FullName)),
                    TableOperators.And,
                    TableQuery.GenerateFilterCondition("RowKey", QueryComparisons.Equal, StorageStore <object, object> .GetSafeStorageKey(rsn.ToString("N")))
                )
                             );

            return(ReadableSource.ExecuteQuery(rangeQuery).Single());
        }