When a view model is created you can populate the options (e.g. used in a dropdown list) into a setter property of the view model. The problem is that when that view model is later passed as a parameter (by the framework!) into an action method, those property values has not become automagically repopulated, so if you need to redisplay the form because of validation errors, you need to repopulate those options again.
One potential solution, which I am asking for specifically in this question, is how to make the MVC framework instantiate the view model with constructor injection, which would provide the view model constructor with an implementation of some kind of data access object (e.g. a repository) that can be used for retrieving the options when they are requested by the view (e.g. in the helper method "DropDownListFor") ?
I think the solution might have something to do with implementations of IModelBinderProvider or IModelBinder but after having experimented with these things from example code snippets here and there on the net, I am still looking for a completely working example, with downloadable executable code without any missing piece of how putting all things together.
If you are looking for some alternative discussion about how to populate a select list, e.g. with "Dependecy Lookup" instead of "Dependecy Injection" you may want to check out the following discussion: Best way to populate SelectList for ViewModel on GET/POST Best way to populate SelectList for ViewModel on GET/POST
Some days ago I wrote the following follow-up-question in that thread about the "Dependecy Injection" I am now looking for in this thread: https://mcmap.net/q/1482700/-best-way-to-populate-selectlist-for-viewmodel-on-get-post (which provides a code example about the problem I am looking for a solution of)
But instead of hoping that someone will find that old thread with a less specific title, I have created this new question with a more specific subject about what I am looking for. And I will also provide a link from that thread into this new question for anyone that want to follow-up regarding this specific solution I am looking for.