microsoft / kiota-http-dotnet

Kiota http provider implementation for dotnet with HttpClient
https://aka.ms/kiota/docs
MIT License
35 stars 15 forks source link

Access to just the types of the handlers #255

Closed svrooij closed 6 months ago

svrooij commented 6 months ago

Related to this discussion where I want to enable everybody to use dependency injection instead of the self implemented HttpClient factory.

I'm not sure if this code would be better, I don't like the dependency it takes on reflection. But it would reduce it to only have one list to keep.

public static IList<DelegatingHandler> CreateDefaultHandlers()
{
    return GetDefaultHandlerTypes()
        .Select(handlerType => (DelegatingHandler)System.Activator.CreateInstance(handlerType))
        .ToList();
}

Fixed #254

svrooij commented 6 months ago

Thanks for the contribution here

Any chance you can bump the version in the csproj file as well as add a changelog entry at the repository root?

Sure @andrueastman, there you go.

svrooij commented 6 months ago

@baywet this change means the proposed doc update can be more easily. Any idea on when this gets released and do you want me to update the docs pr already?

baywet commented 6 months ago

working on the release :) Follow #257 for now