Skip to content

Type registered with Singleton instantiating multiple times #649

Answered by dadhi
furqansafdar asked this question in Q&A
Discussion options

You must be logged in to vote

@furqansafdar

Replace the registration with RegisterMany:

        // Registering singletons
        container.Register<RuleMenuOptionItem>(Reuse.Singleton);
        container.Register<INavMenuItem, RuleMenuOptionItem>(Reuse.Singleton);

with

        container.RegisterMany<RuleMenuOptionItem>(Reuse.Singleton);

Check the docs.

Replies: 3 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by furqansafdar
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #647 on June 18, 2024 15:20.