I'm trying to figure out how I can benefit from the new .netcore HttpFactory dependency injection to register the VSS clients in my startup class like so:
public async Task Method([FromServices] WorkItemTrackingHttpClient client, int id)
{
var workitem = await client.GetWorkItemAsync(id);
//do something with the workitem...
}
Currently, I'm facing this exception when doing the above:
InvalidOperationException: A suitable constructor for type 'Microsoft.TeamFoundation.WorkItemTracking.WebApi.WorkItemTrackingHttpClient' could not be located. Ensure the type is concrete and services are registered for all parameters of a public constructor.
Has any one managed to do it?
Would be good to have a sample for this.
Hello!
I'm trying to figure out how I can benefit from the new .netcore HttpFactory dependency injection to register the VSS clients in my startup class like so:
and then in a service/controller method:
Currently, I'm facing this exception when doing the above: InvalidOperationException: A suitable constructor for type 'Microsoft.TeamFoundation.WorkItemTracking.WebApi.WorkItemTrackingHttpClient' could not be located. Ensure the type is concrete and services are registered for all parameters of a public constructor.
Has any one managed to do it? Would be good to have a sample for this.
Thanks, Yoni