public void Test() { var ctr = new Container(Rules.Default .With(propertiesAndFields: req => req.ImplementationType.GetProperties().Select(PropertyOrFieldServiceInfo.Of)) .WithResolveIEnumerableAsLazyEnumerable()); var shortReuse = new ShortReuse(); ctr.Register <Y>(Reuse.Singleton); ctr.Register <IX>(shortReuse, Made.Of(() => new X())); var y = ctr.Resolve <Y>(); var o = y.Xs().FirstOrDefault(); // Exception here }
public void Test() { var ctr = new Container(Rules.Default.With( propertiesAndFields: PropertiesAndFields.Auto)); ctr.Register <C>(reuse: Reuse.Singleton); var shortReuse = new ShortReuse(); ctr.Register <B>(reuse: shortReuse); ctr.Register <D>(reuse: shortReuse); var c = ctr.Resolve <C>(); var d = c.D(); Assert.IsNotNull(d.B.Value); }