Invalid cast when use enum
Closed this issue · 1 comments
Describe the bug
A clear and concise description of what the bug is.
when use enum type in call method parameter, System.InvalidCastException: Invalid cast from 'System.Int64' to enum type
To Reproduce
Steps to reproduce the behavior:
*
namespace HelloWorld.Shared
{
public interface ISayHelloService
{
event Action<string, string> MessageReceived;
void Say(string name, TestEnum message);
}
}
public enum TestEnum
{
Test1,
Test2
}
- when start server and client
- invalid cast exception
Expected behavior
Is possible to when use enum in client, server aslo can receive enum type. now I replace use int to instead
Additional notes
thks for your project
Thank you for posting that issue.
It is now fixed in source code (23c3869) and also in the current nuget package (version 1.1.12).
I also baked the change with a unit test.