C#C
C#2y ago
SpReeD

✅ Blazor / ASP.NET - @inject keyed service

Is there a way in .NET 8 to inject a keyed service like a normal service with the @inject keyword?
I know of the FromKeyedServices attribute, but cannot figure out how to use it in combination with @inject.
I thought of a way like @inject [FromKeyedServices("MyService")] ServiceClass FooBar;
Was this page helpful?