Auto inject property for register types wihtout DependencyAttribute.
Posted
by ais
on Stack Overflow
See other posts from Stack Overflow
or by ais
Published on 2010-05-09T06:53:42Z
Indexed on
2010/05/09
6:58 UTC
Read the original article
Hit count: 195
Register<IA, A>();
class B { public IA A {get;set;}}
//container inject this property because IA was registered
In autofac you can do
builder.RegisterType<A>().InjectProperties();
for this.
Is there any extension for unity to do this? Or may be extension which I can use as sample for implement this feature by myself?
© Stack Overflow or respective owner