decorate every element for the model with JsonProperty("")
decorate every element with custom attribute KontentElementId()
Proposed solution
Example of the mode would looks like that:
The name of the attributes might be a subject of change
The namespaces are illustrative, wee need to add the ones we need
Namespace for KontentElementId Attribute will be probably Kentico.Kontent.Management.Modules.ModelBuilders
using System;
using Kentico.Kontent.Management.Models.Assets;
using Kentico.Kontent.Management.Models.Items;
using Kentico.Kontent.Management.Models.Items.Elements;
using Kentico.Kontent.Management.Modules.ModelBuilders;
using Newtonsoft.Json;
namespace KenticoKontentModels
{
public partial class MyContentType
{
[JsonProperty("text")]
[KontentElementId("77108990-3c30-5ffb-8dcd-8eb85fc52cb1")]
public TextElement Text { get; set; }
}
}
Additional context
Don't forget about the docs, but wait for the initial implementation review so that we don't need to rewrite documentation multiple times.
Motivation
Related to https://github.com/Kentico/kontent-management-sdk-net/pull/67
As a part of the upgrade, we decided to:
Proposed solution
Example of the mode would looks like that:
Kentico.Kontent.Management.Modules.ModelBuilders
Additional context
Don't forget about the docs, but wait for the initial implementation review so that we don't need to rewrite documentation multiple times.