Azure/azure-functions-dotnet-extensions

[FEATURE REQ] Fluent Strongly Typed Context

MhAllan opened this issue · 0 comments

We have two problems with C# sdk
1- It is not strongly typed
2- It is unreadable, long methods and too much attributes

Suggestion suppose people to put Activities in interface or class. the the IDurableOrchestrationContext should be able to produce proxy for strongly typed methods

let's instead of

class ActivityClass
{
    [FunctionName(nameof(MethodName))]
    public Task<string> MethodName(int x)
}
//orchestrator
context.CallActivityWithRetryAsync<T>(nameof(ActivityClass.MethodName), retryOptions, input);

We should be able to do:

class ActivityClass
{
    public Task<string> MethodName(int x)
}
//orchestrator
context.ClientOf<AcitivyClass>().WithRetry(retryOptions).MethodName(10);

Will be great