|
content.AppendChild(content.CreateElement(string.IsNullOrEmpty(_rootElementName) ? _data.RootElementName : _rootElementName, _data.NamespaceUri)); |
If you attempt to instantiate Fields for a multimedia Schema/Component, there is no rootElementName for the content. So if you try to do something like this:
Fields.ForContentOf(schemaFields, _componentData);
you come out with a situation where _rootElementName and _data.RootElement name are both null, and CreateElement throws an exception.
tridion-practice/ChangeContentOrMetadata/CreateContentOrMetadata/CreateContentOrMetadata.cs
Line 36 in 74f53c5
If you attempt to instantiate Fields for a multimedia Schema/Component, there is no rootElementName for the content. So if you try to do something like this:
Fields.ForContentOf(schemaFields, _componentData);you come out with a situation where _rootElementName and _data.RootElement name are both null, and CreateElement throws an exception.