从http://www.liensberger.it/web/blog/?p=191:
private static bool CheckIfAnonymousType(Type type){ if (type == null) throw new ArgumentNullException("type"); // HACK: The only way to detect anonymous types right now. return Attribute.IsDefined(type, typeof(CompilerGeneratedAttribute), false) && type.IsGenericType && type.Name.Contains("AnonymousType") && (type.Name.StartsWith("<>") || type.Name.StartsWith("VB$")) && type.Attributes.HasFlag(TypeAttributes.NotPublic);}编辑:
扩展方法的另一个链接:确定类型是否为匿名类型


![如何测试类型是否为匿名?[重复] 如何测试类型是否为匿名?[重复]](http://www.mshxw.com/aiimages/31/421413.png)
