Search code examples
episerverepiserver-7episerver-6episerver-8

Episerver - Automatically delete Properties from Episerver when deleted in code


I'm working on my first EPI Server project and I have noticed that when I create a property on a 'Page Type' in C# Code, compile it, I can see the properties in Episerver.

However when I then delete that property in code the property still appears in the back office, and I have to manually delete it in the admin section.

Is there a setting in Epi server that will automatically delete properties from the EPI server database when they are removed from code? It seems very strange that you would have to delete the properties one by one every time you make a change to a Page Type.


Solution

  • The properties are automatically removed if they don't contain any data in any instance of the page. I'd say this is a good way to keep things.

    However demands vary, there is no button that can override the default behaviour but you can implement something yourself. Jouni posted a solution on epi world a while ago https://world.episerver.com/forum/developer-forum/-Episerver-75-CMS/Thread-Container/2016/4/how-do-you-deal-with-development-when-property-types-could-be-changing/