Skip to content

Instantly share code, notes, and snippets.

View MilanLund's full-sized avatar

Milan Lund MilanLund

View GitHub Profile
@MilanLund
MilanLund / RebuildIndexPostStartModule.cs
Last active September 13, 2024 10:57
Rebuild search index on application start in Xperience by Kentico
using CMS;
using CMS.Base;
using CMS.Core;
using CMS.DataEngine;
using Kentico.Xperience.Lucene.Core.Indexing;
[assembly: RegisterModule(typeof(RebuildIndexPostStartModule))]
public class RebuildIndexPostStartModule : Module
{
@MilanLund
MilanLund / MigrationHelper.cs
Last active June 17, 2024 10:46
Migrate Content from Kentico CMS Portal Engine to Xperience by Kentico
using CMS.ContentEngine;
using CMS.MediaLibrary;
using CMS.Membership;
using CMS.Websites;
using CMS.Websites.Routing;
using Kentico.Content.Web.Mvc;
using CMS.DataEngine;
using Kentico.Content.Web.Mvc.Routing;
namespace Project.Helpers;
@MilanLund
MilanLund / ContentRepositoryBase.cs
Last active October 10, 2024 07:14
Repository pattern with a Generic type for a Xperience by Kentico project
using CMS.ContentEngine;
using CMS.Helpers;
using CMS.Websites;
using CMS.Websites.Routing;
namespace YourProject.Models;
public abstract class ContentRepositoryBase
{
protected IWebsiteChannelContext WebsiteChannelContext { get; init; }