zcz527 / autofac

Automatically exported from code.google.com/p/autofac
Other
0 stars 0 forks source link

Subdependencies are not being instantiated using parameters supplied #478

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Consider the following code:

class A { }
class B { ctor(A a) {} }
class C { ctor(B b) {} }

void ShouldResolveC() {
    var builder = new ContainerBuilder();
    builder.RegisterType<B>();
    builder.RegisterType<C>();

    var container = builder.Build();
    var factory = container.Resolve<Func<A, C>>();

    var a = new A();
    var c = factory(new A());
}

Observed result: DependencyResolutionException (Cannot resolve parameter A a)
Expected result: c == new C(new B(a))
Autofac version: trunk

Original issue reported on code.google.com by Eugene.S...@gmail.com on 10 Dec 2013 at 10:32

GoogleCodeExporter commented 8 years ago
Here is the proposed solution

Original comment by Eugene.S...@gmail.com on 10 Dec 2013 at 10:33

Attachments:

GoogleCodeExporter commented 8 years ago

Original comment by travis.illig on 10 Dec 2013 at 11:30

GoogleCodeExporter commented 8 years ago
Moved issue to GitHub: https://github.com/autofac/Autofac/issues/478

Subsequent issue management will be held there; closing the issue on Google 
Code as "WontFix" because we will handle issue resolution on GitHub.

Original comment by travis.illig on 11 Feb 2014 at 12:01

GoogleCodeExporter commented 8 years ago
Yeah, lets wont fix it without an explanation!

Original comment by Eugene.S...@gmail.com on 11 Feb 2014 at 10:45

GoogleCodeExporter commented 8 years ago
Please see the comment above regarding the issue being moved to GitHub. We 
don't "WontFix" without providing comment. :)

Original comment by alex.meyergleaves on 11 Feb 2014 at 12:27