dadhi / DryIoc

DryIoc is fast, small, full-featured IoC Container for .NET
MIT License
1.01k stars 123 forks source link

how to get Reslove Singleton when two inherited interfaces but only one implementation? #568

Closed sgf closed 1 year ago

sgf commented 1 year ago
public interface  IAppCtxBase
{
}

public interface IAppCtx : IAppCtxBase
{
}

public interface AppCtx : IAppCtx 
{
}

var appCtx1=IContainer.Resolve<IAppCtxBase>();
var appCtx2=IContainer.Resolve<IAppCtx>();
var same=appCtx1==appCtx2;

expect: same=True

now: same=False

sgf commented 1 year ago

ok,i got the what i want.

https://github.com/dadhi/DryIoc/issues/6