How do I change the following from Autofac to use the Common Service Locator (where _context is of type IComponentContext):
var query = _context.Resolve<IContentQuery>(TypedParameter.From<IContentManager>(this));
The code above is taken from Orchard, and I'm trying to remove the Autofac dependency. Normally I would try something like:
var query = ServiceLocator.Current.GetInstance<IContentQuery>();
However, this returns null, and I don’t see how to handle the TypedParameter stuff, since I don’t understand what it does.
I would really appreciate it if someone could help. Thanks
source
share