I'm new to AutoFac and i am trying to auto inject my property with the instance that i registered with AutoFac.
public class PersonalDataProvider
{
public ISocialAppUnitOfWork SocialAppUnitOfWork
{
get
{
var resolver = Setup();
return resolver.Resolve<ISocialAppUnitOfWork>();
}
}
private IContainer Setup()
{
var builder = new ContainerBuilder();
builder.RegisterType<ISocialAppUnitOfWork>().PropertiesAutowired();
return builder.Build();
}
}
The line that causes the except: builder.RegisterType().PropertiesAutowired();
I'd like to get the ISocialAppUnitOfWork of the provider.
I'm not sure what's going on at the moment, any help would be appreciated.