sdk/dotnet/src/Microsoft.Datasync.Client/Serialization/ServiceSerializer.cs
/// <summary>
/// Removes all system properties from the instance.
/// </summary>
/// <param name="instance">The subject instance.</param>
/// <param name="version">When complete, set to the version system property before it is removed.</param>
/// <returns>The subject instance with the system properties removed.</returns>
Removes all system properties from the instance.
Removes all system properties from the instance .
public static JObject RemoveSystemProperties(JObject instance, out string version)
        {
            version = null;
            bool haveCloned = false;
            foreach (JProperty prop in instance.Properties())
            {
                if (SystemProperties.AllSystemProperties.Contains(prop.Name, StringComparer.OrdinalIgnoreCase))
                {
                    if (!haveCloned)
                    {
                        instance = instance.DeepClone() as JObject;
                        haveCloned = true;
                    }
                    if (string.Equals(prop.Name, SystemProperties.JsonVersionProperty, StringComparison.OrdinalIgnoreCase))
                    {
                        version = (string)instance[prop.Name];
                    }
                    instance.Remove(prop.Name);
                }
            }
            return instance;
        }
public static JObject RemoveSystemProperties ( JObject instance , out string version ) { version = null ; bool haveCloned = false ; foreach ( JProperty prop in instance . Properties ( ) ) { if ( SystemProperties . AllSystemProperties . Contains ( prop . Name , StringComparer . OrdinalIgnoreCase ) ) { if ( ! haveCloned ) { instance = instance . DeepClone ( ) as JObject ; haveCloned = true ; } if ( string . Equals ( prop . Name , SystemProperties . JsonVersionProperty , StringComparison . OrdinalIgnoreCase ) ) { version = ( string ) instance [ prop . Name ] ; } instance . Remove ( prop . Name ) ; } } return instance ; }
Removes all system properties from the instance.
Removes all system properties from the instance .
The subject instance with the system properties removed.
The subject instance with the system properties removed .
instance
JObject
The subject instance.
The subject instance .
string
out
version
When complete, set to the version system property before it is removed.
When complete set to the version system property before it is removed .