Using SC10.1 & XC 10.1
I'm trying to get catalog items with a search criteria.
The code in this Sitecore document to get the Storefrontcontext is not working.
var searchManager = CommerceTypeLoader.CreateInstance<ISearchManager>();
var storefrontContext = ServiceLocator.ServiceProvider.GetRequiredService<IStorefrontContext>();
SearchRepository searchRepository = new SearchRepository(searchManager, storefrontContext);
searchRepository.SearchCatalogItemsByKeyword("mdn","Brand", 10);
'IServiceProvider' does not contain a definition for 'GetRequestService' and no accessible extension method 'GetRequestService' accepting a first argument of type 'IServiceProvider' could be found.