When I
container.RegisterType<IInterface, MyClass>();
everything works, and all dependent properties annotated with:
[Dependency]
are resolved through the container.
But, I now have an int property that I'd like also to resolve through the container. It's not passed in the constructor, but just as a public property. So I tried this:
container.RegisterType<IInterface, MyClass>(
new InjectionProperty("PropertyName", 1)
);
Now that property gets injected, but all the other properties annotated with [Dependency] are null and not resolved. If I use InjectionProperty for one property, do I now have to explicitly declare all the other properties that have the [Dependency] attribute?? Or is there a better way to do this?
Thanks.