Why does DynamicModuleManager.GetDataItems(type) return duplicate items?
QUESTION:
In Sitefinity 4.4, I created a new custom module with module builder. I entered 4 items, but when I retrieve them with GetDataItems, I get 8 back. Why am I getting a duplicate of each?
DETAILS:
Each item looks like this:
Top Menu Items
-------------------
menuItem (string)
menuBody (long text)
sortOrder (numeric)
I entered 4 items. Only 4. They are simple. I run the following code to retrieve those 4 items in order (based on the sort order), and I get 8 back. Why?
DynamicModuleManager dynamicModuleManager = DynamicModuleManager.GetManager();
Type topMenuItemType = TypeResolutionService.ResolveType(
"Telerik.Sitefinity.DynamicTypes.Model.TopMenus.TopMenuItem"
);
var MenuItems = dynamicModuleManager.GetDataItems(topMenuItemType).OrderBy(
"menuOrder"
).AsEnumerable();
Looking into the DynamicContent that was returned, the duplicate items are mostly the same except:
If I add the following, it works as intended. (I get 4 results rather than duplicated 8)
.Where(
"Visible == true"
)