/// <summary>
        /// Creates properties for the given <see cref="T:Newtonsoft.Json.Serialization.JsonContract" />.
        /// </summary>
        /// <param name="type">The type to create properties for.</param>
        /// <param name="memberSerialization">The member serialization mode for the type.</param>
        /// <returns>Properties for the given <see cref="T:Newtonsoft.Json.Serialization.JsonContract" />.</returns>
        protected override IList <JsonProperty> CreateProperties(Type type, MemberSerialization memberSerialization)
        {
            List <JsonProperty> properties = new List <JsonProperty>(base.CreateProperties(type, memberSerialization));

            if (!includeFields)
            {
                IEnumerable <string> propertyMembers = CustomContractResolver.GetPropertyMembers(type).Select(n => n.Name);
                properties.RemoveAll(n => !propertyMembers.Contains(n.PropertyName));
                foreach (var property in properties)
                {
                    Type normalized = normalizer.Invoke(property.PropertyType);
                    if (normalized != null && normalized != property.PropertyType)
                    {
                        property.MemberConverter = new JsonReaderConverter(normalized);
                    }
                }
            }
            return(properties);
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="WebHttpJsonNetBehavior"/> class.
        /// </summary>
        /// <param name="knownTypes">The known types.</param>
        /// <param name="enableUriTemplate">if set to <c>true</c> [enable URI template].</param>
        public WebHttpJsonNetBehavior(IEnumerable <Type> knownTypes, bool enableUriTemplate = true) : base(knownTypes, enableUriTemplate)
        {
            SerializerSettings     serializerInfo = this.ConfigRegister.SerializerConfig;
            CustomContractResolver resolver       = new CustomContractResolver(true, false, this.ConfigRegister.TryToNormalize)
            {
                DefaultMembersSearchFlags = BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.Public
            };

            this.Serializer = new JsonSerializer {
                NullValueHandling     = NullValueHandling.Ignore,
                ReferenceLoopHandling = ReferenceLoopHandling.Ignore,
                TypeNameHandling      = TypeNameHandling.None,
                ContractResolver      = resolver
            };
            if (!serializerInfo.OnlyPublicConstructor)
            {
                Serializer.ConstructorHandling = ConstructorHandling.AllowNonPublicDefaultConstructor;
            }
            if (serializerInfo.EnablePolymorphicMembers)
            {
                Serializer.Binder           = new OperationTypeBinder(this.ConfigRegister);
                Serializer.TypeNameHandling = TypeNameHandling.Objects;
            }
        }