private void AddObjectsToSubIndexes(IEnumerable<MemoryObject> objects)
{
IDictionary<object, IList<MemoryObject>> objsByPropVal =
SplitObjectsByProperty(objects);
foreach (KeyValuePair<object, IList<MemoryObject>> objByPropVal in objsByPropVal)
{
_subIndexes[objByPropVal.Key] = _grandchildProperties == null
? (IMemoryIndex)new SinglePropertyMemoryIndex(_daLayer, _childProperty, objByPropVal.Value)
: new MultiPropertyMemoryIndex(_daLayer, _childProperty, _grandchildProperties, objByPropVal.Value);
}
}