-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add possibility to specify parameter to RPC invocation #1798
Conversation
…accessible in TopicGenerationContext.
{ | ||
MethodName = methodName ?? throw new ArgumentNullException(nameof(methodName)); | ||
Parameters = parameters ?? EmptyParameters; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please leave the parameter null because otherwise the user can modify the instance of the "empty" dictionary because it is not read only (immutable).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @chkr1011 for review.
Would it be ok if I changed type for parameters from IDictionary
to IReadOnlyDictionary
? I would like to avoid checking for null in client code if not necessary.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That would indeed circumvent the issue but I am afraid that maybe some users want to change these values and use it as a way to return data to the caller as well. So I would leave it null here. If you want to avoid checking for null all the time (what I can understand) you may pass an "Empty" immutable instance on your own.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Made parameters nullable as suggested.
Fixes #1796