0

After a while, I was successfully able to wire up Castle Windstor DI (IOC) to my WebApi project.

Now, I am trying to understand how it works.

For the above reason,

  1. Who creates an instance of a WebAPI controller?
  2. How to put breakpoint for debugging how Windstor Castle actually works?

Just want to say that I am using VS2012 and WebAPI 2 if that helps. :)

  • Debug Windstor Castle in what way? IIS and ASP .NET would create the WebAPI controller. – rhughes May 22 '14 at 11:48
  • possible duplicate of [What is the lifetime of a ASP.NET MVC Controller?](http://stackoverflow.com/questions/2355139/what-is-the-lifetime-of-a-asp-net-mvc-controller) – Numan May 22 '14 at 11:49
  • @rhughes @Nauman: The given links are talking about `MVC Controller`. Is it the same for `WebAPI` too ? – now he who must not be named. May 22 '14 at 11:52
  • @nowhewhomustnotbenamed. please see this SO quesiton http://stackoverflow.com/questions/9494966/difference-between-apicontroller-and-controller-in-asp-net-mvc – Numan May 22 '14 at 11:54

2 Answers2

2

Here are the direct answers to your questions...

  1. MVC engine is responsible for instantiating a controller (Check links in question comments)
  2. You need source for Castle windsor: Read DI in .NET by Mark Seemann
Numan
  • 3,918
  • 4
  • 27
  • 44
0

The microsoft poster here explains this very clearly.