Exemplo n.º 1
0
        public static async T.Task <IEnumerable <Job> > GetJobsAsync(
            this CloudUtilities u,
            string lowPartitionKey,
            string highPartitionKey,
            int count               = 100,
            JobType type            = JobType.ClusRun,
            bool reverse            = false,
            CancellationToken token = default(CancellationToken))
        {
            var jobTable = u.GetJobsTable();

            var partitionRange = u.GetPartitionKeyRangeString(lowPartitionKey, highPartitionKey);
            var rowKey         = u.JobEntryKey;

            var q = TableQuery.CombineFilters(
                partitionRange,
                TableOperators.And,
                TableQuery.GenerateFilterCondition(CloudUtilities.RowKeyName, QueryComparisons.Equal, rowKey));

            var results = await jobTable.QueryAsync <Job>(q, count, token);

            return(results.Select(r => { r.Item3.UpdatedAt = r.Item4; return r.Item3; }));
        }