How do I use StructureMap with generic unclosed types using Scan with a “greedy” constructor

Are there any concrete implementations of IToCsvService? Or just the open type ToCsvService?

ConnectImplementationsToTypesClosing is for connecting something like a concrete CustomerViewModelToCsvService to IToCsvService<>. If you want to connect open classes to open interfaces, you’ll need:

For(typeof(IToCsvService<>)).Use(typeof(ToCsvService<>));

Here I’m connecting the open interface type to the open class type.

Leave a Comment

tech