Each data structure saved in the Optimizely Dynamic Data Store (DDS) is given an identity. This identity is represented by the
EPiServer.Data.Identity class, which contains the following parts:
System.Guid, an External ID either supplied by the user of the DDS or generated dynamically.
System.Int64, a Store ID generated by the store.
The implementer of a .NET class that will be stored in the DDS can choose to explicitly manage the ID the objects get when stored. This can be done in the following ways:
- Implement the
- Implement the
- Implement a property called ID of the type
UsingManagedIdentity class in the DDS sample project for examples of specific identity management.
The DDS supports POCO objects. When POCO objects are stored in the DDS, special care needs to be taken when saving (updating) existing objects. Because the DDS does not have an ID it can use to determine if an object is new or existing, it relies on state information held for objects that have been previously loaded through the same instance of the DDS when saving them back.
UsingImplicitidentity class in the DDS sample project for examples of implicit identity management.
By default, dates are stored as unspecified, which means it is the responsibility of the data class to convert to local or UTC time.
You can change this behavior by using the
EPiServerDataStoreAttribute, for example:
[EPiServerDataStore(DatabaseDateTimeKind = DatabaseDateTimeKind.Utc)]. When this is activated, all dates and times are automically converted when loading and saving. When using LINQ, the actual date and time stored in the database is used, no automatic conversion takes place. See also Storing UTC date and time in the database (Legacy).
Updated 5 months ago