Five New Optimizely Certifications are Here! Validate your expertise and advance your career with our latest certification exams. Click here to find out more

Alternative to unifiedFile in EPIServer 10

Vote:
 

Is there anyone expert in EPIServer.

I need help to migrate code from Version 6 to 10.

I have this code in my file and it gives error after i migrated to Version 10.

public void Initialize(InitializationEngine context)
    {
        UnifiedFile.UnifiedFileCheckedIn += UnifiedFile_UnifiedFileCheckedIn;
    }

It gives error on UnifiedFile.The name unifiedfile does not exist in current context.

Like this many errors related to it.

What is alternative for this?
#202415
Mar 26, 2019 6:28
Vote:
 

In Episerver 10, everything is IContent.

https://world.episerver.com/documentation/developer-guides/CMS/learning-path/media-support/

You can create an initialization module that listens to content events:

[InitializableModule]
[ModuleDependency(typeof(InitializationModule))]
public class MyModule : IInitializableModule
{
    public void Initialize(InitializationEngine context)
    {
        var contentEvents = context.Locate.Advanced.GetInstance<IContentEvents>();
        contentEvents.CheckedInContent += ContentEvents_CheckedInContent;
    }

    private void ContentEvents_CheckedInContent(object sender, ContentEventArgs e)
    {
        // ...
    }

    public void Uninitialize(InitializationEngine context)
    {
        // ...
    }
}
#202419
Mar 26, 2019 9:42
* 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.