using Microsoft.Practices.Unity;
..
..
public class ContentsController : BaseController
{
[Dependency]
public IContentService contentService { get; set; }
}
I am using Unity to give me an instance of IContentService. However it will only work if I declare this to be public. If I declare private then it _cs is null?
Is the only way I can get this to work by declaring it public ?
Can I declare the IContentService in the controller constructor? If I did that then can someone show me the best syntax and how I would connect this up to a private variable?