Browse Source

Add determines whether the subscriber parameter is an instance of the current type. #669

master
Savorboard 4 years ago
parent
commit
04a272a780
1 changed files with 8 additions and 1 deletions
  1. +8
    -1
      src/DotNetCore.CAP/Internal/ISubscribeInvoker.Default.cs

+ 8
- 1
src/DotNetCore.CAP/Internal/ISubscribeInvoker.Default.cs View File

@@ -73,7 +73,14 @@ namespace DotNetCore.CAP.Internal
} }
else else
{ {
executeParameters[i] = Convert.ChangeType(message.Value, parameterDescriptors[i].ParameterType);
if (parameterDescriptors[i].ParameterType.IsInstanceOfType(message.Value))
{
executeParameters[i] = message.Value;
}
else
{
executeParameters[i] = Convert.ChangeType(message.Value, parameterDescriptors[i].ParameterType);
}
} }
} }
} }


Loading…
Cancel
Save