-
-
Notifications
You must be signed in to change notification settings - Fork 119
Open
Description
// Register Bar service without providing a name:
serviceContainer.Register<Bar>();
// The following code injects Lazy<Bar> but it should fail because there is no service Bar with name "some-name":
Consumer ([Inject("some-name")] Lazy<Bar> lazyBar) {
// this also does not fail:
Console.WriteLine(lazyBar.Value.ToString());
}Inject attribute is effectively ignored when Lazy<> is used. According to the source code service name is not used when Lazy<> is requested.
I'm trying to use named services to create Lazy<HttpClient> automatically via RegisterFallback but this bug prevents RegisterFallback from running.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels