File tree Expand file tree Collapse file tree 2 files changed +18
-1
lines changed
Expand file tree Collapse file tree 2 files changed +18
-1
lines changed Original file line number Diff line number Diff line change @@ -113,6 +113,20 @@ public static bool IsEnum(this Type type)
113113#endif
114114 }
115115
116+ /// <summary>
117+ /// Returns a value indicating if the given <paramref name="type"/> is a primitive.
118+ /// </summary>
119+ /// <param name="type">The type for which to make the determination.</param>
120+ /// <returns>True if the given <paramref name="type"/> is a primitive, otherwise false.</returns>
121+ public static bool IsPrimitive ( this Type type )
122+ {
123+ #if NET_STANDARD
124+ return type . GetTypeInfo ( ) . IsPrimitive ;
125+ #else
126+ return type . IsPrimitive ;
127+ #endif
128+ }
129+
116130 /// <summary>
117131 /// Returns a value indicating if the given <paramref name="type"/> is a generic type.
118132 /// </summary>
Original file line number Diff line number Diff line change 11{
2- "projects" : [ " NetStandardPolyfills" ]
2+ "projects" : [ " NetStandardPolyfills" ],
3+ "sdk" : {
4+ "version" : " 1.0.0-preview2-003131"
5+ }
36}
You can’t perform that action at this time.
0 commit comments