class Foo
{
}
[TestMethod]
public async Task ScopedServiceWithOpenResolutionScope()
{
var container = new Container();
container.Register<Foo>(Reuse.Scoped, setup: Setup.With(openResolutionScope: true));
var foo = container.Resolve<Foo>();
Assert.IsNotNull(foo);
var actual = container.Resolve<IEnumerable<Foo>>();
Assert.AreEqual(1, actual.Count());
}
the first resolve would be resolved normally, but container.Resolve<IEnumerable>() would return an empty collection.
If we remove Reuse.Scoped from the registration then collection contains one item.
Not obvious why the collection is empty. And if it is a bug.
the first resolve would be resolved normally, but container.Resolve<IEnumerable>() would return an empty collection.
If we remove Reuse.Scoped from the registration then collection contains one item.
Not obvious why the collection is empty. And if it is a bug.