title: Dependency injection in custom workflow activity
body: <p>I have a standard application that has a workflow. The customer can customize the workflow in the designer. Now we are making some custom activities for a specific customer. The custom activity is communicating against the business layer by a interface. How do I give the interface an implementation of that interface? </p>
  
  <p>It is very important that the standard application doesn't know about the interface and implementation of that interface because it is custom code for that specific customer. The activity is found by standard workflow so that works already. </p>
  
  <p>I see a lot of information about extensions but I don't really know how it works.</p>
  
  <p>Custom activity</p>
  
  <pre><code>public sealed class GetDealerDetails : CodeActivity
  {
      /////// &lt;summary&gt;
      /////// The dealer controller with all the businesslogic.
      /////// &lt;/summary&gt;
      ////private readonly IDealerController _dealerController;
  
      [Inject]
      public IDealerController DealerController { private get; set; }
  
      ////public GetDealerDetails()
      ////{
  
      ////}
  
      ////[Inject]
      ////public GetDealerDetails(IDealerController dealerController)
      ////{            
      ////    _dealerController = dealerController;
      ////}
  
      protected override void Execute(CodeActivityContext context)
      {
          Dealer dealer = DealerController.GetDealerDetails(5);
      }
  }
  </code></pre>
  
  <p>I use Ninject in my standard application. I tried to use constructor injection and property injection but it doesn't work. The <code>DealerController</code> stays <code>null</code>.</p>
  
  <p><strong>Edit</strong>
  The rest of the code can be found here: <a href="https://stackoverflow.com/questions/15482476/inject-custom-code-in-standard-application">Inject custom code in standard application</a></p>