Take the 2-minute tour ×

I want to build an N-Tier application.

Client (WebJson-MVC, WebSoap-WCF)

Client depends on API that depends on BLL that depends in DAL.
So lets say that I want to inject API to the clients(WebJson-MVC, WebSoap-WCF) .
Since there are 2 clients, what is the best way to do the injection? To which project should I import the Dependency injection frame work?
What is the workaround for this?
Where do I suppose to initialize the context? IApplicationContext ctx = ContextRegistry.GetContext();

Edit 1
If I will create the dependency injection in the WebJson-MVC and I want to inject the bll to the api don't I couple the MVC with the BLL, isnt that bad to have the bll and the client tidely coupled? Also, how do I suppose to inject the API to WebSoap-WCF?


share|improve this question
add comment

1 Answer

To the WebJson-MVC framework, without question. Initialization in the MVC framework would be in the ApplicationStart() of the Global.asax.cs file.

share|improve this answer
Thanks, see my Edit in the question. –  SexyMF Jul 16 '12 at 6:15
In the model I'm currently working out the bugs on and using (MVC4/WebAPI/IoC and DI (Unity)) the API/BLL/DAL are all on the same "side" as they are all share the same project (asp.net WebAPI is kind of like WCF on steriods (but skinnier(like Bruce Lee)). The services (SOAP-WCF(if I had to use them)) would only be used if there was an integration mandate to use SOAP/WCF. Provided I had to use SOAP/WCF I'd simply make the crud calls etc on the WebAPI side and serialize into whatever the recipient needed. If this is ambiguous my apologies. I'm newb with WebAPI and may not be giving good guidance –  Computer Guy Jul 16 '12 at 6:45
add comment

Your Answer


