public void UsingLibraryDirectly() { //SiteContext is only used as a shortcut extensions method when using Sitecore.Context.Site. //So you can pass it null //The following key-value pair will get saved to Core DB DynamicStorageExtensions.SetDynamicStorageValue(null, "Name", "TamerMehyar"); //Gets retrieved from CoreDB since cache will still be empty var myName = DynamicStorageExtensions.GetDynamicStorageValue(null, "Name"); //Gets retrieved from Cache var myNameCached = DynamicStorageExtensions.GetDynamicStorageValue(null, "Name"); }
private void DynamicModel_PropertyChanged(object sender, PropertyChangedEventArgs e) { DynamicStorageExtensions.SetDynamicStorageValue(null, e.PropertyName, this.GetType().GetProperty(e.PropertyName).GetValue(this)?.ToString()); }