/// <summary>
            /// Adds all properties found on an entry to the payload order items.
            /// </summary>
            /// <param name="entry">The entry to inspect.</param>
            /// <param name="payloadOrderItems">The payload order items to add to, or null, if nothing should be done.</param>
            private static void AddEntryPayloadOrderItems(ODataEntry entry, ODataEntryPayloadOrderObjectModelAnnotation payloadOrderItems)
            {
                if (payloadOrderItems == null) return;

                if (entry.Id != null) payloadOrderItems.AddEntryProperty("Id");
                if (entry.TypeName != null) payloadOrderItems.AddEntryProperty("TypeName");
                if (entry.EditLink != null) payloadOrderItems.AddEntryProperty("EditLink");
                if (entry.ReadLink != null) payloadOrderItems.AddEntryProperty("ReadLink");
                if (entry.ETag != null) payloadOrderItems.AddEntryProperty("ETag");
                if (entry.MediaResource != null)
                {
                    payloadOrderItems.AddEntryProperty("MediaResource");
                    AddStreamReferenceValuePayloadOrderItems("MediaResource_", entry.MediaResource, payloadOrderItems);
                }

                if (entry.Actions != null)
                {
                    foreach (ODataAction action in entry.Actions)
                    {
                        payloadOrderItems.AddAction(action);
                    }
                }

                if (entry.Functions != null)
                {
                    foreach (ODataFunction function in entry.Functions)
                    {
                        payloadOrderItems.AddFunction(function);
                    }
                }

                if (entry.Properties != null)
                {
                    foreach (ODataProperty property in entry.Properties)
                    {
                        payloadOrderItems.AddODataProperty(property);
                        ODataStreamReferenceValue streamPropertyValue = property.Value as ODataStreamReferenceValue;
                        if (streamPropertyValue != null)
                        {
                            AddStreamReferenceValuePayloadOrderItems(property.Name + "_", streamPropertyValue, payloadOrderItems);
                        }
                    }
                }
            }