13
Verilen kayıtlı hizmetler adında halletmeye çalıştığı?AutoFac en Func <T> hizmet
public class SomeClass(Func<string, IFoo> foo) {
var f = foo("one");
Debug.Assert(f is Foo1);
var g = foo("two");
Debug.Assert(g is Foo2);
var h = foo("three");
Debug.Assert(h is Foo3);
}
ben Meta<>
ile yapabilirsiniz biliyorum ama kullanmak istemiyorum.
Büyük fikir! Teşekkürler :). – ppiotrowicz
Küçük düzenleme - 'c' parametresi geçicidir; Buna asmak isterseniz IComponentContext'i çözmeniz gerekir. c => {var cc = c.Resolve(); return => cc.Resolve (named); } –
@Nicholas: ah, elbette, gözden kaçırmak çok kolay :) –