Eliminated info creation for non-public properties (#2278)
authorYoh Deadfall <yoh.deadfall@hotmail.com>
Sun, 2 Feb 2020 19:56:18 +0000 (22:56 +0300)
committerGitHub <noreply@github.com>
Sun, 2 Feb 2020 19:56:18 +0000 (11:56 -0800)
src/libraries/System.Text.Json/src/System/Text/Json/Serialization/JsonClassInfo.cs

index dcc2a92e18dd15a2a6551d8314d54cd2eb1c1e45..e6fc4cc6cce7f8480a7c7a917e8b5d0281a9413d 100644 (file)
@@ -138,7 +138,7 @@ namespace System.Text.Json
                     {
                         CreateObject = options.MemberAccessorStrategy.CreateConstructor(type);
 
-                        PropertyInfo[] properties = type.GetProperties(BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic);
+                        PropertyInfo[] properties = type.GetProperties(BindingFlags.Instance | BindingFlags.Public);
 
                         Dictionary<string, JsonPropertyInfo> cache = CreatePropertyCache(properties.Length);