Virtual Happy Hour this month, Jun 28, we'll be getting a sneak preview at our soon to launch SaaS CMS!

Try our conversational search powered by Generative AI!

solution for DataFactory.Instance.CreatingPage & DataFactory.Instance.PublishingPage in Episerver v11

Vote:
 

Hi Team,

We are doing migration for Epi CMS from 7.5 to 11 and facing issue in below code:

DataFactory.Instance.CreatingPage += MyFunction;
DataFactory.Instance.PublishingPage += MyFunction;

now in v11 , these EventHandler are not part of DataFactory class and i was wondering , how can it is handled in latest version of CMS.

#185884
Dec 05, 2017 17:05
Vote:
 

Look for `EPiServer.Core.IContentEvents`

#185885
Dec 05, 2017 17:31
Vote:
 

While the answer from Valdis is correct, it is worth noting that you should be using IContentRepository instead of DataFactory these days. Episerver now is all about interfaces & dependency injection.

#185888
Dec 05, 2017 18:06
Vote:
 

:) "all".. there are still some places in framework that needs to be taken care of ;) no offense here..

#185889
Dec 05, 2017 18:11
* 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.