-
Notifications
You must be signed in to change notification settings - Fork 19
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
Allow access to service provider on ConfigureODataClient #28
Comments
This code: public class PeopleController : ODataController
{
private readonly IODataClientFactory _clientFactory;
public PeopleController(IODataClientFactory clientFactory)
{
_clientFactory = clientFactory;
}
[EnableQuery]
public IEnumerable<Person> Get()
{
var client = _clientFactory.CreateClient<DefaultContainer>();
var people = client.People.Execute();
return people;
}
} Does not work. |
Hello, Has this problem been adressed ? We can see that in the documentation https://docs.microsoft.com/en-us/odata/client/using-extensions#named-clients You allow configuration of the CreateClient within the Startup.cs but no constructor exists for CreateClient that takes no parameter |
How has this not been resolved yet? This seems like such a strange oversight, how does everyone else work around this? |
I have the same question too. Any new input? |
I'm facing the same issue, any news on this? |
Hi,
I have a tenant app that has various services that provide information about the current tenant, user, and the URLs to be used to access server resources, per tenant/user.
It's called
IUriProvider
.I can see the method in
DefaultODataClientFactory
based onserviceRoot
.But I rather them all to be based on the underlying
IHttpClientFactory
's providedHttpClient.BaseAddress
.In addition, the
IOdataClientFactory.CreateClient<T>
, also requires aserviceRoot
argument. This is unnecessary if it has already been configured, or if there is an underlyingHttpClient
whoseBaseAddress
should be used for this matter instead.Asking for
Uri
s all over the place which would rely on constants, is a bad habit and somewhat defies the power of DI.The text was updated successfully, but these errors were encountered: