ipjohnson / Grace

Grace is a feature rich dependency injection container library

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Export generic interface with constraint(s)

mcdis opened this issue · comments

commented

Dear Johnson!

Can you tell me if I can export the generic interface given the constraints?

Example:

_.Export(typeof(ConfProvider<>)).As(typeof(IObservable<>).WithConstaints<IMsg>.Lifestyle.Singleton()

I want to bind IObservable<T> where IMsg to ConfProvider<T>

Hi @mcdis,

You should be able to do When.MeetsCondition((strategy, staticContext) => /* inspect T using reflection here */)