Beispiel #1
0
        public Task Upgrade(IVersionContext versionContext)
        {
            var themeAssembly     = Assembly.Load("Themes.PersonalBlog");
            var themeRegistration = ThemeUtils.GetThemeRegistration(themeAssembly);
            var currentTheme      = new Theme
            {
                Id             = "5f02cb57e63b2b3634d51371",
                Name           = themeRegistration.Name,
                Description    = themeRegistration.Description,
                Creator        = themeRegistration.Creator,
                ScreenShotUri  = themeRegistration.ScreenShotUri,
                ThemeManifests = ThemeUtils.GatherAllManifests(themeAssembly)?.ToList(),
                SectionParts   = ThemeUtils.GetSectionParts(themeAssembly)?.ToList()
            };

            versionContext.InsertData(currentTheme);
            return(Task.CompletedTask);
        }