views:

288

answers:

1

I am using Composite Application Block. I have a class that uses constructor injection (using the [ServiceDependency] attribute on the constructor parameter) and it's working. But when I try to switch to using property injection (with the [ServiceDependency] attribute on the property), the injection is not happening (the property stays null).

I made sure that the property has the same type that the old constructor parameter had, and it's public.

Edit: This is C# / .NET

+1  A: 

It works for me, hmm... Should look like here

public class ProjectListViewPresenter : Presenter<IProjectListView>
{
    private ILookupService _lookupService;

    [ServiceDependency]
    public ILookupService LookupService
    {
        get { return _lookupService; }
        set { _lookupService = value; }
    }
}
Yacoder