Moving project from CMS 8.11 to 10 -- DataFactory.Instance.CreatingPage and Category.Find

Vote:
 

Hi,

I am in the process of moving our site from 8.11 to 10. Everything is more or less going okay. I was able to successfully upgrade to 9, and then when I upgraded to 10 I got some compilation errors. I was expecting this, and I have been replacing apis that are now gone with the newer ones.

The problem right now is that I am having problems finding how to replace two apis.

The first one is those that are connected with Page creation events, things like this one

DataFactory.Instance.CreatingPage

The second one has to do with querynig Categories like this:

Category.Find

What are the objects that I should use for this two cases?

Thanks in advance.

#183150
Oct 05, 2017 20:36
Vote:
 

First

var contentEvents = ServiceLocator.Current.GetInstance<IContentEvents>();

contentEvents.CreatingPage += YourMethod()

Second

var categoryRepository = ServiceLocator.Current.GetInstance<CategoryRepository>();

categoryRepository.Find()
#183195
Oct 06, 2017 13:34
Vote:
 
<p>Thanks so much!</p>
#183498
Oct 16, 2017 15:53
This topic was created over six months ago and has been resolved. If you have a similar question, please create a new topic and refer to this one.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.