Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

More than one generated Client Api will result in an Extension Method Conflict for ConfigureRefitClients #294

Closed
robpalm opened this issue Jan 18, 2024 · 6 comments · Fixed by #298
Assignees
Labels
enhancement New feature, bug fix, or request

Comments

@robpalm
Copy link
Contributor

robpalm commented Jan 18, 2024

Is your feature request related to a problem? Please describe.
If you have more than one generated Client Api which use DependyInjectionSettings, then the generated ServiceCollection Extensions ConfigureRefitClients will Conflict.

Describe the solution you'd like
Add a new Setting, e.g. ExtensionMethodName, in DependyInjectionSettings with Default Value: ConfigureRefitClients

@robpalm robpalm added the enhancement New feature, bug fix, or request label Jan 18, 2024
@christianhelle
Copy link
Owner

@robpalm Thanks for taking the time to report this

I haven't thought about that scenario. I built that feature for myself and my teams and our use case was the API's we build come with a client SDK (nuget package) so that consumers of our API's only have to install the nuget package. This works very well for me and my teams, at least for the backend side of things

Anyway, your request is trivial to build so I'll see if I can implement it tonight

@christianhelle
Copy link
Owner

@robpalm I think you should be able to work around this by specifying different namespaces for different clients

robpalm added a commit to robpalm/refitter that referenced this issue Jan 18, 2024
@christianhelle
Copy link
Owner

@robpalm You're more than welcome to build the feature yourself. Just create a PR and if all tests are green then let's get it in and publish a release

@christianhelle
Copy link
Owner

@all-contributors please add @robpalm for ideas

Copy link
Contributor

@christianhelle

I've put up a pull request to add @robpalm! 🎉

@robpalm
Copy link
Contributor Author

robpalm commented Jan 18, 2024

@robpalm I think you should be able to work around this by specifying different namespaces for different clients

I think that is possible only if you split up the DI Setup in different classes, one per client, with different namespace using.

I can build it and create a PR. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature, bug fix, or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants