Many thanks for this chapter, see questions below:
How do I when to use a 3rd party DI or IoC in my project
Why did you use an extension method for ToViewModel and ToServiceModel? Although it seems a little confusing to me but I will go over it again till am able to understand it's use case.
Which other way can be use to achieve the use of the extension method as you have done without using an extension method?
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)
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.
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?
Many thanks for this chapter, see questions below:
How do I when to use a 3rd party DI or IoC in my project
Why did you use an extension method for ToViewModel and ToServiceModel? Although it seems a little confusing to me but I will go over it again till am able to understand it's use case.
Which other way can be use to achieve the use of the extension method as you have done without using an extension method?
Thank you for your reply always.
Hi there!
Let's see if I can answer all of them:
GroupMappings.ToViewModel(group)
, we can dogroup.ToViewModel()
. Was this the question, or another thing?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.