diff --git a/source/Halibut/Portability/TypeExtensions.cs b/source/Halibut/Portability/TypeExtensions.cs index 8a5eefebf..80f0d373e 100644 --- a/source/Halibut/Portability/TypeExtensions.cs +++ b/source/Halibut/Portability/TypeExtensions.cs @@ -17,5 +17,10 @@ public static bool IsValueType(this Type type) { return type.IsValueType; } + + public static bool IsNullable(this Type type) + { + return !type.IsValueType() || Nullable.GetUnderlyingType(type) != null; + } } } diff --git a/source/Halibut/ServiceModel/ServiceInvoker.cs b/source/Halibut/ServiceModel/ServiceInvoker.cs index 29e6f3556..87339b153 100644 --- a/source/Halibut/ServiceModel/ServiceInvoker.cs +++ b/source/Halibut/ServiceModel/ServiceInvoker.cs @@ -68,7 +68,7 @@ static MethodInfo SelectAsyncMethod(IList methods, RequestMessage re { var paramType = parameters[i].ParameterType; var argType = argumentTypes[i]; - if (argType == null && paramType.IsValueType()) + if (argType == null && !paramType.IsNullable()) { isMatch = false; break;