ASP.NET MVC controller dependency injection for beginners - Online Free Computer Tutorials.

'Software Development, Games Development, Mobile Development, iOS Development, Android Development, Window Phone Development. Dot Net, Window Services,WCF Services, Web Services, MVC, MySQL, SQL Server and Oracle Tutorials, Articles and their Resources

Tuesday, March 12, 2013

ASP.NET MVC controller dependency injection for beginners

In a simple statement if I want to define an ASP.NET MVC controller then I can say that it has classes which are responsible for receiving and processing incoming requests, handling client input, and sending response back to the client. Controllers also act as a coordinator between Model (Business) and View (Presentation). ASP.NET MVC framework itself create controller object at run time. Only prerequisite is controller class must have a parameter less constructor. But if you need to pass some objects with constructor then what will happen? Simply framework failed to create controller object. In that scenario we need to create controller object by our self and injection dependency there.


I guess you came to this post by searching similar kind of issues in any of the search engine and hope that this resolved your problem. If you find this tips useful, just drop a line below and share the link to others and who knows they might find it useful too.

Stay tuned to my blogtwitter or facebook to read more articles, tutorials, news, tips & tricks on various technology fields. Also Subscribe to our Newsletter with your Email ID to keep you updated on latest posts. We will send newsletter to your registered email address. We will not share your email address to anybody as we respect privacy.


This article is related to

ASP.NET, MVC, Dependency Injection, Computer Tutorials, .Net, Beginners Tutorials

No comments:

Post a Comment