What dependency injection means is that instead of writing code like this in your controller
private IBlogService _BlogService; public BlogController() { _BlogService = new BlogService(); } you write code like this
private IBlogService _BlogService; public BlogController(IBlogService blogService) { _BlogService = blogService; } the benefits of dependency injection are your classes are not tightly coupled, are more testable, and really is pluggable.
No comments yet, be the first one to post comment.