Open weitzhandler opened 4 years ago
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.
There is no overload of CreateClient
that can take care of the serviceUri
parameters on its own.
Please address this.
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 underlyingIHttpClientFactory
'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 forUri
s all over the place which would rely on constants, is a bad habit and somewhat defies the power of DI.