I'm trying to get a registered service in an HtmlHelper extension. How can I get to the autofac container that has all registered services?
var ctx = DependencyResolver.Current.GetService<IUserContext>();
var container = new ContainerBuilder().Build();
var ctx = container.Resolve<IUserContext>();
but both don't work.
Is there a way to access the services registered in the container from a static function?