If I don't understand wrong, it means that when IConnectivity is requested, it is passeed Connectivity.Current, that is a specific implementation of IConnectivity. So it is not possible to pass another implementation.
So my cuestion is, if I have an own implementation of IConnectivity, how could I decide to use the Connectivity.Current or my own implementation?
Perhaps with the connectivity it has not too much sense, but I am thinking in general and for example in unit tests, in which I could be interested in using my own imlpementantion.
When you register the services for IConnectivity, you use this code:
builder.Services.AddSingleton<IConnectivity>((e) => Connectivity.Current);
If I don't understand wrong, it means that when IConnectivity is requested, it is passeed Connectivity.Current, that is a specific implementation of IConnectivity. So it is not possible to pass another implementation.
So my cuestion is, if I have an own implementation of IConnectivity, how could I decide to use the Connectivity.Current or my own implementation?
Perhaps with the connectivity it has not too much sense, but I am thinking in general and for example in unit tests, in which I could be interested in using my own imlpementantion.
Thanks.