public void ApplyOnRootFirst(object item, IObjectContext context, MaterializerTracker tracker) { if (item == null) { return; } //Returns if object has already been processed in this context. if (!tracker.BeginTrackObject(item)) { return; } if (_actionInfo != null) { _actionInfo.ApplyAction(item, context); } if (_runtimeCollectionElementInfo != null && item is IEnumerable) { foreach (var element in (item as IEnumerable)) { _runtimeCollectionElementInfo.ApplyOnRootFirst(element, context, tracker); } } if (_runtimeMembers.Length > 0) { foreach (var runtimeMember in _runtimeMembers) { var memberValue = runtimeMember.MemberInfo.GetFieldOrPropertyValue(item); runtimeMember.RuntimeInfo.ApplyOnRootFirst(memberValue, context, tracker); } } }