Code reference for creating child items doesn't seem right
I'm looking at the Code reference Sitefinity provides when you create a Dynamic Module with the Module Builder.
When I look at the "Create a your content type Entry" something doesn't seem right.
The following code is how you supposedly get the parent item ID:
// Gets the id of the first item of the parent type
private
Guid GetParentId(DynamicModuleManager dynamicModuleManager, Type parentType)
DynamicContent parent = dynamicModuleManager.GetDataItems(parentType)
.Where(i=>i.Status == ContentLifecycleStatus.Master).First();
return
parent.Id;
What doesn't make sense about this code is that at no point do you actually define 'which' parent you want. It's like it's grabbing the first parent item that has a Status of master, but that could be anyone.
The code comment confirms this but surely the documentation around this, or at the very least a comment could suggest that you should get a specific parent item.
?
Kriek kriek, kriek kriek.