title: Instantiating a new object with Constructor parameters using Ninject
body: <p>I'm trying to refactor some code to use IoC with the Ninject framework. So far I have managed to successfully inject in classes in scenarios where I do not have any constructor parameters to pass. However I am having difficulties when it comes to passing in parameters. This is the third binding in the binding class below.</p>
  
  <p><strong>Binding Class</strong></p>
  
  <pre><code>public class Bindings : NinjectModule
      {
          public override void Load()
          {
              Bind&lt;ILogger&gt;().To&lt;Logger&gt;();
              Bind&lt;IPlayerDatadao&gt;().To&lt;PlayerDatadao&gt;();
              Bind&lt;IPlayerScores&gt;().To&lt;PlayerScores&gt;();
          }
      }
  </code></pre>
  
  <p>The logger class has a parameterless constructor and works fine when transferred to Ninject.</p>
  
  <p><strong>Success</strong></p>
  
  <pre><code>    // IoC creation
      var kernel = new StandardKernel();
      kernel.Load(Assembly.GetExecutingAssembly());
  
      //Log User details
      var logger = kernel.Get&lt;ILogger&gt;();
      logger.LogVisitorDetails();
  </code></pre>
  
  <p>However, my attempt below threw an exception</p>
  
  <p><strong>Failure</strong></p>
  
  <pre><code>        string priceString = Foo();
          string pointsString = Bar();
  
          return kernel.Get&lt;IPlayerScores&gt;(new[] { new ConstructorArgument("pointsString", pointsString), new ConstructorArgument("points", priceString) });
  </code></pre>
  
  <p>This is the class with its constructor.</p>
  
  <p><strong>Class to Inject</strong></p>
  
  <pre><code>public class PlayerScores : IPlayerScores
  {
      [Inject]
      public string points { get; set; }
      [Inject]
      public string price { get; set; }
      public PlayerScores(string Points, string Price)
      {
          points = Points;
          price = Price;
      }
  }
  </code></pre>
  
  <p>I'm really not sure how I should be handling the parameters either in the binding class or at the point of injection</p>