sdk/dotnet/src/Microsoft.Datasync.Client/Serialization/DatasyncContractResolver.cs
/// <summary>
/// Applies the system property attribute to the property by renaming the property to the
/// system property name.
/// </summary>
/// <param name="property">The property.</param>
/// <param name="member">The <see cref="MemberInfo"/> that corresponds to the property.</param>
Applies the system property attribute to the property by renaming the property to the
system property name.
Applies the system property attribute to the property by renaming the property to the system property name .
private static void ApplySystemPropertyAttributes(JsonProperty property, MemberInfo member)
        {
            List<string> systemProperties = new();
            foreach (object attribute in member.GetCustomAttributes(true))
            {
                if (attribute is ISystemPropertyAttribute systemProperty)
                {
                    property.PropertyName = systemProperty.PropertyName;
                    if (systemProperties.Contains(property.PropertyName))
                    {
                        throw new InvalidOperationException("A type can only have one system property attribute for each system property.");
                    }
                    else
                    {
                        systemProperties.Add(property.PropertyName);
                    }
                }
            }
        }
private static void ApplySystemPropertyAttributes ( JsonProperty property , MemberInfo member ) { List < string > systemProperties = new ( ) ; foreach ( object attribute in member . GetCustomAttributes ( true ) ) { if ( attribute is ISystemPropertyAttribute systemProperty ) { property . PropertyName = systemProperty . PropertyName ; if ( systemProperties . Contains ( property . PropertyName ) ) { throw new InvalidOperationException ( " " ) ; } else { systemProperties . Add ( property . PropertyName ) ; } } } }
Applies the system property attribute to the property by renaming the property to the
system property name.
Applies the system property attribute to the property by renaming the property to the system property name .
property
JsonProperty
None
member
MemberInfo
The  that corresponds to the property.
The that corresponds to the property .