Closed Sevitas closed 1 year ago
Add information about this feature to https://github.com/kontent-ai/delivery-sdk-net/blob/master/docs/customization-and-extensibility/rich-text/structured-rich-text-rendering.md
Once released also linked the link above from https://github.com/kontent-ai/delivery-sdk-net/issues/356#issuecomment-1413360086 (updated as a part of https://github.com/kontent-ai/delivery-sdk-net/issues/356) (update of neccesarry)
Also, please, update information about this feature to https://github.com/kontent-ai/delivery-sdk-net/blob/master/docs/customization-and-extensibility/strong-types-explained/code-generator.md
Motivation
As part of #356 we added new
DateTimeContentConverter
to Delivery .NET SDK to have a possibility to convert DateTimeElement to customDateTimeContent
model, which has the following interface:At the same time, we kept the possibility to convert DateTimeElement to system
DateTime?
type the same as it worked before.It's needed to extend the model generator's functionality to let customers choose, whether they want to convert DateTimeElement to simple
DateTime?
value (previous behavior) or to customIDateTimeContent
model.Proposed solution
It seems reasonable to use similar approach as for RichTextElement converting. Model generator creates a property of
string
or customIRichTextContent
model depending on--structuredmodel <True|False>
parameter value. As we discussed on grooming, we can change type ofstructuredmodel
property from currentbool
tostring
, so that it will contain a list of element types, for which custom type will be generated. Currently, there will be two possible elements, for with structured model could be generated:So, possible
structuredmodel
property format could be--structuredmodel richtext|datetime
Additional context
Add any other context, screenshots, or reference links about the feature request here.