Esempio n. 1
0
            public void ApplyOn(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 (_runtimeCollectionElementInfo != null && item is IEnumerable)
                {
                    foreach (var element in (item as IEnumerable))
                    {
                        _runtimeCollectionElementInfo.ApplyOn(element, context, tracker);
                    }
                }

                if (_runtimeMembers.Length > 0)
                {
                    foreach (var runtimeMember in _runtimeMembers)
                    {
                        var memberValue = runtimeMember.MemberInfo.GetFieldOrPropertyValue(item);
                        runtimeMember.RuntimeInfo.ApplyOn(memberValue, context, tracker);
                    }
                }

                if (_actionInfo != null)
                {
                    _actionInfo.ApplyAction(item, context);
                }
            }