瀏覽代碼

Fix to allow rendering empty anonymous type

Brad Robinson 6 年之前
父節點
當前提交
02786166c5
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      PetaJson.cs

+ 1 - 1
PetaJson.cs

@@ -1945,7 +1945,7 @@ namespace PetaJson
                 }
 
                 // Must have some members
-                if (!members.Any())
+                if (!members.Any() && !Attribute.IsDefined(type, typeof(System.Runtime.CompilerServices.CompilerGeneratedAttribute), false))
                     return null;
 
                 // Create reflection info