0

We are working on upgrading our solution from Sitecore 8.2 to 9.3 and we came across with the VersionCountdisabler() which is used for the purpose of fallback operation on 8.2 code.

Below is the sample code:

        using (new VersionCountDisabler())
        {
           using (new SecurityDisabler())
           {
            return
                _sitecoreContext.SitecoreService.GetItem<IHome_Page> 
                (Common.Constants.ContentItems.ImpersonatePageId.Guid);
           }
        }

And on our research we were not able to find any alternative for this method..Could anyone suggest an alternative for this method VersionCountdisabler() ?

1

1 Answer 1

1

This functionality has been moved to the GetOptions that can be passed to the GetItem function, so you can remove the using (new VersionCountDisabler()) and use the getOptions where you set the getOptions.VersionCount = false and pass these to your GetItem call.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.