Write more elegant Azure Functions with less boilerplate, more consistency, and support for REST APIs. Docs can be found at https://functionmonkey.azurefromthetrenches.com
Have you thought about adding a support of multiple output bindings?
Imagine, in a POST/PUT/DELETE http function would like to
return a json
post a message to a queue (ServiceBus whatever) to notify other microservices about changes
post a message to SignalR to notify web clients about changes
One could use benefits of multiple output bindings and return a set of values.
For instance,
class MultipleResult
{
public MyPoco ReturnResult { get; set; }
public string ServiceBusMessage { get; set; }
public SignalRMessage SignalRMessage { get; set; }
}
class MyCommand : ICommand<MultipleResult>
Along with IFunctionOptions.OutputTo property there could be a method
MultiOutputTo(Expression<Func<TResult, object>> propertySelector) which would extract the property name from propertySelector and store it into a corresponding output binding class as an optional property name.
Also something like IFunctionOptions.BindResultTo((Expression<Func<TResult, object>> propertySelector) to specify a property name to used as a function result (if any) would be necessary.
Hi James,
Have you thought about adding a support of multiple output bindings? Imagine, in a POST/PUT/DELETE http function would like to
One could use benefits of multiple output bindings and return a set of values. For instance,
Along with IFunctionOptions.OutputTo property there could be a method MultiOutputTo(Expression<Func<TResult, object>> propertySelector) which would extract the property name from propertySelector and store it into a corresponding output binding class as an optional property name.
.MultiOutputTo(x => x.ServiceBusMessage).ServiceBusQueue(...)
.MultiOutputTo(x => x.SignalRMessage).SignalRMessage(...)
Also something like IFunctionOptions.BindResultTo((Expression<Func<TResult, object>> propertySelector) to specify a property name to used as a function result (if any) would be necessary.
Sure, templates have to be adjusted.
What do you think?
Regards, Alexey