YairHalberstadt / stronginject

compile time dependency injection for .NET
MIT License
845 stars 24 forks source link

how to inject Func<T,C> #122

Closed trampster closed 3 years ago

trampster commented 3 years ago

I have type that takes a Func<CallInfo, ISession> as a constructor argument.

I have injected it using a Factory in a module

[Factory]
public Func<CallInfo, ISession> CreateSessionFactory()
{
 ....
}

However I'm getting the following error:

Error while resolving dependencies for Pttox.Core.Services.ILinkHandler: we have no source for instance of type 'Pttox.Core.Services.ISession'

This is odd for several reasons,

trampster commented 3 years ago

I was missing Static there was a warning but was hidden by all the errors.