HomeDev GuideAPI Reference
Dev GuideAPI ReferenceUser GuideGitHubNuGetDev CommunityAcademySubmit a ticketLog In
Dev Guide

Configure DDS

Control Dynamic Data Store behavior through configuration settings and programmatic options.

The Dynamic Data Store (DDS) provides configuration options that control type resolution, store remapping, and operation timeouts. Adjust these settings to match your application requirements.

Configure DDS options

Define DynamicDataStoreOptions under EPiServer:Cms in appsettings.json. The following options are available:

  • autoResolveType – Set to true (default) or false.

    When set to true, the Dynamic Data Store attempts to resolve .NET types if the System.Type.GetType method call fails. The resolution first removes version information from the type string and calls Type.GetType again. If that fails, the resolution removes assembly information and calls Type.GetType again. If the type still does not resolve, the system throws an exception.

    When set to false, type resolution occurs through assembly redirects in the configuration file.

  • autoRemapStores – Set to true (default) or false.

    When set to true, the Dynamic Data Store automatically remaps all .NET classes decorated with the EPiServerDataStoreAttribute attribute where the AutomaticallyRemapStore property is set to true. Remapping occurs when the class and store mappings are no longer aligned.

    When set to false, no automatic remapping occurs for any class.

    ❗️

    Warning

    In multi-instance environments (such as Azure App Service or load-balanced servers), automatic remapping (autoRemapStores = true together with AutomaticallyRemapStore = true on a type) can cause transient Invalid column name errors during a deployment that adds, removes, or renames properties. See Multi-instance deployment considerations for the cause and recommended mitigations.

  • DeleteAllOperationTimeout – The extended command timeout for deleting all items in a store.

{
  "EPiServer" : {
    "Cms" : {
      "DynamicDataStore" : {
        "AutoResolveTypes"          : "true/false",
        "AutoRemapStores"           : "true/false",
        "DeleteAllOperationTimeout" : "time span"
      }
    }
  }
}

Change configuration programmatically

To modify Dynamic Data Store configuration at runtime, use the EPiServer.Data.Dynamic.DynamicDataStoreOptions class. Configure IServiceCollection in the ConfigureServices method of the Startup class during site initialization.

public class Startup {
  public void ConfigureServices(IServiceCollection services) {
    ...

    services.Configure<DynamicDataStoreOptions>(options => {
      options.AutoRemapStores = true or false;
      options.AutoResolveTypes = true or false;
      options.DeleteAllOperationTimeout = TimeSpan.FromSeconds(xxx);
    });

    ...
  }
}

Recommendations

Follow these best practices when working with the Dynamic Data Store:

  • Create or obtain instances of DynamicDataStore on the stack, use them, and then discard them. The Dynamic Data Store is not thread safe. If multiple threads share an instance, protect it with thread-locking techniques.
  • Implement EPiServer.Data.IDynamicData or a Guid property called Id on your objects to control the external identity of stored objects.
  • Use the same instance of a Dynamic Data Store to load and then update a POCO object (object without identity).