Search code examples
episerverdomaindatasourceepiserver-6

EPiServer DDS Change Schema for type


I am storing a type in the EPiServer DDS that has a few properties such as string and guid. I now want to add a new property of type string to that type. How is it possible to get the DDS to recognise the new property added to the type and add it to the schema for the type in the DDS.


Solution

  • You need to remap the type to the store like this:

    Let's say your class is called Car

    var store = DynamicDataStoreFactory.Instance.GetStore(typeof(Car)); store.StoreDefinition.Remap(typeof(Car)); store.StoreDefinition.CommitChanges();

    If you're then going to use the store instance directly after then do a refresh:

    store.Refresh();

    You can find more info about the DDS here: http://world.episerver.com/Documentation/Items/Tech-Notes/EPiServer-CMS-6/EPiServer-CMS-60/Dynamic-Data-Store/

    Paul Smith Developer Evangelist EPiServer