Denis
Denis

Reputation: 12087

Auto-Resolution of Constructor parameters from Unity Container

I would like to create an app where it would auto-magically resolve all my constructor parameters using a unity container. Does anyone have an example on how to accomplish this?

I saw this being done when using Owin but I'm not sure how to whip up something similar for use in any application that I build. Any pointers?

Upvotes: 1

Views: 138

Answers (1)

Haukinger
Haukinger

Reputation: 10873

All constructor parameters as in "all constructors that are ever called" is a heavy requirement. Assuming a desktop application: you can get close if you go for Prism with Unity and use the ViewModelLocator to create your view models.

Upvotes: 2

Related Questions