I can’t seem to get my head around dependency injection in ASP .Net Core.. Like I know what it is but I can’t seem to think of a simple use case for it in my head. Can someone give like a simple example? Plus, it mentioned that whenever you’re injecting a dependency, you shouldn’t use the ‘new’ keyword but instead pass it into a constructor. Why?
For further actions, you may consider blocking this person and/or reporting abuse
Top comments (1)
Hi Andy, thanks for replying. I think I get it.. but you can always use a method to return an object and test it that way no?