Azure / Azure/azure-functions-dotnet-worker

[Tables Extension] Enrich output data with OData annotations

Open
#1,405 0 comments 1 reaction 0 assignees View on GitHub
area: binding extensions: azure-tables
Dominant language
C#
Stars
466
Forks
215
Avg merge
3d 10h
Merged PRs (30d)
7

Description

When using the TablesOutput attribute, the .NET worker should add OData annotations so that type information is not lost. One way to do this would be to register Middleware that does something like this:

```c#
internal class TableEntityMiddleware : IFunctionsWorkerMiddleware
{
public async Task Invoke(FunctionContext context, FunctionExecutionDelegate next)
{
await next(context).ConfigureAwait(false);

var result = context.GetInvocationResult();

if (result.Value != null)
{
result.Value = result.Value.ToOdataAnnotatedDictionary();
}
}
}
```

Where ToOdataAnnotatedDictionary uses the code from here - https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/tables/Azure.Data.Tables/src/Extensions/DictionaryTableExtensions.cs#L19

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the TablesOutput attribute and the IFunctionsWorkerMiddleware example in the issue, then read Azure.Data.Tables' DictionaryTableExtensions.cs at the linked location. Confirm how the invocation result is represented and ensure table output preserves type information through OData annotations; done means the Tables extension enriches returned output without losing existing values.

Written by the indexing model from the issue text.

Assessment

Tech stack
azure, csharp
Domain
databases
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.