Skip to content

Commit 481db36

Browse files
committed
Adding .NET Core SDK version to global.json after installation of VS2017 / Adding Type.IsPrimitive() polyfill
1 parent 32f08a9 commit 481db36

File tree

2 files changed

+18
-1
lines changed

2 files changed

+18
-1
lines changed

NetStandardPolyfills/TypeExtensionsPolyfill.cs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff 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>

global.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
11
{
2-
"projects": [ "NetStandardPolyfills" ]
2+
"projects": [ "NetStandardPolyfills" ],
3+
"sdk": {
4+
"version": "1.0.0-preview2-003131"
5+
}
36
}

0 commit comments

Comments
 (0)