Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7645231
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T09:53:19+00:00 2026-05-31T09:53:19+00:00

I am wondering if Ninject’s kernel Get() function retrieve’s one instanciated instance in the

  • 0

I am wondering if Ninject’s kernel Get() function retrieve’s one instanciated instance in the following snippet:

_kernel = new StandardKernel();
CreateBindings();

ICard card = _kernel.Get<ICard>();
ICard card2 = _kernel.Get<ICard>();

Does card and card2 point to the same instance or do they point to two separate instances? Also, if I had an ICard[] and I wanted to fill the array with 10 unique instances of ICard, how can I do this?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T09:53:20+00:00Added an answer on May 31, 2026 at 9:53 am

    It depends on how binding for that type has been configured. If binding is singleton, both instances would be the same:

    _kernel.Bind<ICard>().To<Card>().InSingletonScope();
    

    However when you use default binding, both instances will be different:

    _kernel.Bind<ICard>().To<Card>();
    

    To fill array use the following code:

    var array = Enumerable.Repeat(1, 10)
         .Select(_ => _kernel.Get<ICard>())
         .ToArray();
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm new to Ninject, and I was wondering if the scope of the kernel
I am new to ninject, I am wondering how I can run custom initizlisation
I was wondering which one is simpler between Ninject and StructureMap ? Is there
Wondering how to open many new windows with Javascript. I have found plenty of
I was trying Ninject in a Asp.net Mvc application and I was wondering what
So I'm starting to use Ninject for dependency injection and I'm wondering what people
Wondering if anyone has used Ninject in a production application? And what pros and
I'm trying to use Ninject to provide my custom MembershipProvider with an instance of
I am wondering how do you do constructor inject with ninject 2.0 when you
Wondering why I can't get document.getElementById("my_div").innerHTML to update the DOM when I re-assign the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.