DEV Community 👩‍💻👨‍💻

Discussion on: Episode 005 - Dependency Injection - ASP.NET Core: From 0 to overkill

joaofbantunes profile image
João Antunes Author

Hi there!
Let's see if I can answer all of them:

  1. If the built-in container is good enough for your needs, probably just stick with it. Otherwise, you can look at alternatives if:
    • You already have experience and like a different container
    • You need some features that another container provides (including performance)
  2. These extension methods are just to move the boilerplate mapping code out of the controller. I could just have mapped everything in there, but the controller code would be polluted with things that are not really relevant for its logic.
  3. Not sure I understand this one. An extension method is a normal static method, with syntactic sugar to make things more readable, so instead of doing GroupMappings.ToViewModel(group), we can do group.ToViewModel(). Was this the question, or another thing?
dyagzy profile image

Thank you for your responses.
I quite understand your answers to my questions (1 and 2).

I guess I should follow up with your tutorial to the next episode perhaps I will better understand your answer to the 3rd question.

I will revert back to you with more questions.