I have a special problem...
Szenario: I have a Contentype, which has two Entity-Fields. One of the Entityfields ist filled, one is empty.I got the data (As DynamicEntity named result1). For the empty entityfield, i got a default value in a Method (as DynamicEntity named result2). Now i want to add result2 in result1 for the empty property. The add-method throw no error but the property remains null...
Example: The contenttype is named Header.
Fields: Titel (string), Font (entityfield), Color (entityfield)
Data: "Title", Selected one item from Contenttype Font, nothing selected.
I fetch the data into result1. result1 is from type ToSic.SexyContent.DynamicEntity
result1.Font is type System.Collections.GenericList`1[ToSic.SexyContent.DynamicEntity] and i can access result1.Font[0].Name and got the value
result1.Color is type System.Collections.GenericList`1[ToSic.SexyContent.DynamicEntity] and value null (result1.Color.Count give me 0)
result2 is from type ToSic.SexyContent.DynamicEntity
Now i want to add result2 with result1.Color.Add(result2); to result1. No error but nothing happens. When i try to access result1.Color[0].name i got the error System.ArgumentOutOfRangeException...
Any Hints?