示例#1
0
        public async Task <Routing> GetAsync(string name)
        {
            var table = _table.Value;

            var filter = TableQuery.GenerateFilterCondition
                         (
                nameof(RoutingEntity.RowKey),
                QueryComparisons.Equal,
                name
                         );

            var query = new TableQuery <RoutingEntity>().Where(filter);

            var result = await table.ExecuteQuerySegmentedAsync(query, null);

            return(result.Results.Select(e => new Routing {
                Name = e.RowKey, Route = e.Route
            }).FirstOrDefault() ?? Routing.Default(name));
        }