Canvas.Courier.CanvasDataResolver.ReplacePropertyDataIds C# (CSharp) Method

ReplacePropertyDataIds() private method

Replaces the property data Ids.
private ReplacePropertyDataIds ( System.Item item, ContentProperty propertyData, Direction direction ) : void
item System.Item The item.
propertyData ContentProperty The property data.
direction Direction The direction.
return void
        private void ReplacePropertyDataIds(Item item, ContentProperty propertyData, Direction direction)
        {
            if (propertyData != null && propertyData.Value != null)
            {
                var dataType = ExecutionContext.DatabasePersistence.RetrieveItem<DataType>(new ItemIdentifier(propertyData.DataType.ToString(),
                    ItemProviderIds.dataTypeItemProviderGuid));

                //Deserialize the value of the current Property to an ArchetypeModel and set additional properties before converting values
                var sourceJson = propertyData.Value.ToString();
                var canvas = JsonConvert.DeserializeObject<CanvasModel>(sourceJson);

                // serialize the Archetype back to a string
                propertyData.Value = JsonConvert.SerializeObject(canvas, Formatting.None);
                
            }
        }