Five New Optimizely Certifications are Here! Validate your expertise and advance your career with our latest certification exams. Click here to find out more
AI OnAI Off
Five New Optimizely Certifications are Here! Validate your expertise and advance your career with our latest certification exams. Click here to find out more
Hate to answer my own question, but I figured out today that I was searching for Uninitialize when I should have been searching for IHostedServices.
There are a couple of examples others have posted in the forums, like Henrik's example here.
https://world.optimizely.com/forum/developer-forum/cms-12/thread-container/2022/3/contentevents-in-cms-12/#275793
And Minesh's example here:
https://world.optimizely.com/forum/developer-forum/cms-12/thread-container/2022/10/making-an-async-http-call-on-publish/#290453
The Dev Guide for CMS 12 says this regarding Initializing the CMS (here):
Custom initialization logic can preferably be done through standard ASP.NET
Core components like for example IStartupFilter or IHostedService. The
IInitializable system (described below) within CMS that was built for
ASP.NET - where there was no central Startup class - is also available in
ASP.NET Core application and can be used also.
Has anyone successfully converted an InitializationModule with events into standard .NET Core components? I found an add-on where the Initialize() method is called during Startup/Configure() but it doesn't use an Uninitialize() method. IHostedService only has StartAsync and StopAsync which might* be comparable to Initialize() and Uninitialize(). (*I'm still learning about IHostedService.)
I have a couple of questions then:
Questions 1 & 3 could be answered if there's a diagram of the startup pipeline for CMS 12.
Thank you!!