hybrid-model-binding icon indicating copy to clipboard operation
hybrid-model-binding copied to clipboard

Extend HybridModelBinderApplicationModelConvention to allow CancellationToken

Open bkaid opened this issue 6 years ago • 0 comments

From #20

When using .AddHybridModelBinder(), this adds a Convention to look for controller-actions which have one complex parameter (i.e. not a string or int) and no currently-assigned BindingSource and assign it with a BindingSource == "Hybrid".

It would be handy for the HybridModelBinderApplicationModel convention to also allow a second parameter to be a CancellationToken to allow the FromHybrid to be removed in this scenario:

public async Task<IActionResult> MyAction([FromHybrid] MyModel myModel, CancellationToken cancellationToken) { }

bkaid avatar Jan 22 '19 21:01 bkaid