private async Task <IFunctionDefinition[]> GetFunctionDefinitionsHelperAsync(CloudTable table)
        {
            var query   = TableScheme.GetRowsInPartition <FunctionDefinitionEntity>(TableScheme.FuncDefIndexPK);
            var results = await table.SafeExecuteQueryAsync(query);

            return(results);
        }
Beispiel #2
0
        public Task <string[]> GetFunctionNamesAsync()
        {
            var query   = TableScheme.GetRowsInPartition <FunctionDefinitionEntity>(TableScheme.FuncDefIndexPK);
            var results = _instanceTable.ExecuteQuery(query).ToArray();

            var functionNames = Array.ConvertAll(results, entity => entity.GetFunctionName());

            return(Task.FromResult(functionNames));
        }
Beispiel #3
0
        private async Task <IFunctionDefinition[]> GetFunctionDefinitionsHelperAsync(CloudTable table, string hostName)
        {
            TableQuery <FunctionDefinitionEntity> query;

            if (hostName == null)
            {
                query = TableScheme.GetRowsInPartition <FunctionDefinitionEntity>(TableScheme.FuncDefIndexPK);
            }
            else
            {
                query = TableScheme.GetRowsWithPrefixAsync <FunctionDefinitionEntity>(TableScheme.FuncDefIndexPK,
                                                                                      TableScheme.NormalizeFunctionName(hostName));
            }
            var results = await table.SafeExecuteQueryAsync(query);

            return(results);
        }
Beispiel #4
0
        public async Task <Segment <IFunctionDefinition> > GetFunctionDefinitionsAsync(string continuationToken)
        {
            var query   = TableScheme.GetRowsInPartition <FunctionDefinitionEntity>(TableScheme.FuncDefIndexPK);
            var results = await _instanceTable.SafeExecuteQueryAsync(query);

            DateTime min = DateTime.MinValue;

            foreach (var entity in results)
            {
                if (entity.Timestamp > min)
                {
                    min = entity.Timestamp.DateTime;
                }
            }

            var segment = new Segment <IFunctionDefinition>(results);

            return(segment);
        }