-
Notifications
You must be signed in to change notification settings - Fork 31
Closed
Labels
Description
Cannot locate object by key and generic.
[Fact]
public void KeyedWithGeneric()
{
var container = new DependencyInjectionContainer();
container.Configure(c =>
{
c.Export(typeof(ImportGenericService<>)).AsKeyed(typeof(IImportGenericService<>), "A");
c.Export<BasicService>().As<IBasicService>();
});
var service = container.Locate<IImportGenericService<IBasicService>>(withKey: "A");
Assert.NotNull(service);
Assert.NotNull(service.Value);
Assert.IsType<BasicService>(service.Value);
}