mercredi 29 juin 2016

Creating Func body dynamically

See the sample below:

var factoryType = typeof(Func<>).MakeGenericType(someType);

I would want to create the function body where an instance of someType will be created using a DI container.

The idea is to configure the DI container so that it can inject Func<SomeClass> into other classes.

How can this be done?





Aucun commentaire:

Enregistrer un commentaire