-
-
Notifications
You must be signed in to change notification settings - Fork 113
Beta 5 - Services does not expose IServiceCollection #42
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
Comments
Those Import that in your .cs or .razor file and you are good to go: using Microsoft.Extensions.DependencyInjection; |
I am not sure why there is a need for an explicit |
I am still getting: Severity Code Description Project File Line Suppression State |
Thats because there is no AddService any more. You need to call AddSingleton now, which is an extension method from Microsoft.Extensions.DependencyInjection. Before beta-5, TestServiceProvider was not a true IServiceCollection, thus it implemented a bunch of AddServices methods. That is now changed, and we rely on the from extension method from Microsoft.Extensions.DependencyInjection. I am sorry if that was not clear enough in the release notes |
While the TestServiceProvider now inherits the IServiceCollection Interface, the IServiceCollection interface is not exposed to the client, leaving the client with no way to register services.
Please expose a property that will return the IServiceCollection.
var modal = new Mock();
Services.AddService(modal.Object); <--- No longer valid.
In addition if you expose IServiceCollection:
services.AddTelerikBlazor(); will be exposed <--- Needed for TelerikGrid
AddScoped
AddSingleton
etc
The text was updated successfully, but these errors were encountered: