Skip to content

Commit

Permalink
Support more targets
Browse files Browse the repository at this point in the history
  • Loading branch information
aalmada committed Oct 10, 2023
1 parent f711c5a commit f6e1177
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/NetFabric.Reflection/NetFabric.Reflection.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net6.0;net7.0</TargetFrameworks>
<TargetFrameworks>netstandard2.1;net5.0;net7.0</TargetFrameworks>
<PackageId>NetFabric.Reflection</PackageId>
<Version>5.0.0</Version>
<Description>Extensions to System.Reflection.</Description>
Expand Down
7 changes: 5 additions & 2 deletions src/NetFabric.Reflection/Reflection/TypeExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ public static bool ImplementsInterface(this Type type, Type interfaceType, [NotN

internal static MethodInfo? GetPublicMethod(this Type type, string name, params Type[] types)
{
var method = type.GetMethod(name, PublicInstance, types);
var method = type.GetMethod(name, PublicInstance, null, types, null);
if (method is not null)
return method;

Expand Down Expand Up @@ -235,7 +235,10 @@ public static bool IsIntegerType(this Type type)
/// </remarks>
public static bool IsFloatingPointType(this Type type)
{
if (type == typeof(Half) ||
if (
#if NET5_0_OR_GREATER
type == typeof(Half) ||
#endif
type == typeof(float) ||
type == typeof(double) ||
type == typeof(decimal))
Expand Down

0 comments on commit f6e1177

Please sign in to comment.