sdk/dotnet/src/Microsoft.Datasync.Client/Serialization/DatasyncContractResolver.cs
/// <summary>
/// Creates a collection of <see cref="JsonProperty"/> instances for the members of a given type.
/// </summary>
/// <remarks>
/// This method checks for and applies system property attributes.
/// </remarks>
/// <param name="type">The type used to create the collection of <see cref="JsonProperty"/> instances.</param>
/// <param name="memberSerialization">Member serialization options for the type.</param>
/// <returns>A list of <see cref="JsonProperty"/> instances for the type.</returns>
Creates a collection of  instances for the members of a given type.
Creates a collection of instances for the members of a given type .
protected override IList<JsonProperty> CreateProperties(Type type, MemberSerialization memberSerialization)
        {
            lock (createPropertiesForTypeLocks)
            {
                if (!createPropertiesForTypeLocks.ContainsKey(type))
                {
                    createPropertiesForTypeLocks.Add(type, new object());
                }
            }
            lock (createPropertiesForTypeLocks[type])
            {
                var properties = base.CreateProperties(type, memberSerialization);
                TypeInfo typeInfo = type.GetTypeInfo();
                if (tableNameCache.ContainsKey(type) || tableNameCache.Keys.Any(t => t.GetTypeInfo().IsAssignableFrom(typeInfo)))
                {
                    properties = properties.Where(prop => prop.Writable).ToList();
                    _ = GetIdProperty(type, properties);
                    var relevantProperties = FilterJsonPropertyCacheByType(typeInfo);
                    foreach (var property in properties)
                    {
                        var memberInfo = relevantProperties.Single(x => x.Value == property).Key;
                        SetMemberConverters(property);
                        ApplySystemPropertyAttributes(property, memberInfo);
                    }
                }
                return properties;
            }
        }
protected override IList < JsonProperty > CreateProperties ( Type type , MemberSerialization memberSerialization ) { lock ( createPropertiesForTypeLocks ) { if ( ! createPropertiesForTypeLocks . ContainsKey ( type ) ) { createPropertiesForTypeLocks . Add ( type , new object ( ) ) ; } } lock ( createPropertiesForTypeLocks [ type ] ) { var properties = base . CreateProperties ( type , memberSerialization ) ; TypeInfo typeInfo = type . GetTypeInfo ( ) ; if ( tableNameCache . ContainsKey ( type ) || tableNameCache . Keys . Any ( t => t . GetTypeInfo ( ) . IsAssignableFrom ( typeInfo ) ) ) { properties = properties . Where ( prop => prop . Writable ) . ToList ( ) ; _ = GetIdProperty ( type , properties ) ; var relevantProperties = FilterJsonPropertyCacheByType ( typeInfo ) ; foreach ( var property in properties ) { var memberInfo = relevantProperties . Single ( x => x . Value == property ) . Key ; SetMemberConverters ( property ) ; ApplySystemPropertyAttributes ( property , memberInfo ) ; } } return properties ; } }
Creates a collection of  instances for the members of a given type.
Creates a collection of instances for the members of a given type .
// If this type is for a known table, ensure that it has an Id. // Set any needed converters and look for system property attributes.
A list of  instances for the type.
A list of instances for the type .
type
Type
The type used to create the collection of  instances.
The type used to create the collection of instances .
memberSerialization
MemberSerialization
Member serialization options for the type.
Member serialization options for the type .
remarks
This method checks for and applies system property attributes.
This method checks for and applies system property attributes .