In Kentico Cloud I got an Item which contains a list of linked items. However this list should be edited from outside with the Kentico Cloud Management API. Is there a way to simply add an Item to this list without updating the whole list?
I am working with the Kentico Cloud SDK in C# and what I have tried so far is upserting a language variant with a new Array of ContentItemIdentifier.byId but whenever I call this it overwrites my already existing list.
private async Task AddOrderToDay(string orderItemExternalId, Guid dayId)
{
ContentItemVariantIdentifier ident = new ContentItemVariantIdentifier(
ContentItemIdentifier.ById(dayId),
LanguageIdentifier.DEFAULT_LANGUAGE);
UpdateOrdersDay update = new UpdateOrdersDay
{
Orders =
new[]{ContentItemIdentifier.ByExternalId(orderItemExternalId)}
};
ContentItemVariantModel<UpdateOrdersDay> response =
await this._cmclient.UpsertContentItemVariantAsync(ident, update);
}
What I'd expect is that my new element is added to the existing list of elements in Cloud.
At the moment it simply overwrites them. I tried a workaround: I call the delivery Api to receive the current Items and add them to new new [] {old1, old2, new ItemIdentifier}. However this solution is not very performant.