Orchard: Using InfosetPart to store "Data" in orchard_framework_contentitemversionrecord

StackOverflow https://stackoverflow.com/questions/22724067

  •  23-06-2023
  •  | 
  •  

After reading Bertrand Le Roy's Blog about the shift to document storage, the InfosetPart in Orchard 1.8 and understanding some of the upgraded Modules in Orchard 1.8 "1.x" source code i have successfully made some of my modules compatible with Orchard 1.8.

But i am having a hard time understanding how the same scheme of document storage would work for ContentPartVersionRecord types so that my content part's data start persisting in "Data" column of orchard_framework_contentitemversionrecord table.

I would be highly thankful for any guidance.

有帮助吗?

解决方案

If you want to store your data versioned in the infoset just use the overload of Store/Retrieve in your part that lets you set versioned = true, e.g.:

Store<TPart, TProperty>(this TPart contentPart, Expression<Func<TPart, TProperty>> targetExpression, TProperty value, bool versioned = false)
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top