Publish overload with notification of type object
See original GitHub issueThe IMediator
interface contains the following method:
Task Publish(object notification, CancellationToken cancellationToken = default);
In its implementation Mediator
there is however a runtime type check if the argument notification
implements INotification
. Why does the interface allow object
if callers are supposed to only pass instances which implement INotification
?
Issue Analytics
- State:
- Created 4 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
Overloading a method which accepts `object` as default ...
I need to be able to call a method and pass in an object of an unknown type but then have the correct...
Read more >Object Overloading - XPN InfoSec Blog
The first thing to notice here that the C: object is actually referencing \Device\HarddiskVolume3 (the actual volume may vary on your system).
Read more >Publish and subscribe to messages - .NET MAUI
In this example, the Subscribe method subscribes the this object to Hi messages that are sent by the MainPage type, and executes a...
Read more >Deprecation of '==' operator overload and fake null for ...
Specifically using the `Option` type with a public accessor results in some undesired behavior (Some(null) instead of None). I do see the point ......
Read more >Incremental overload resolution in object-oriented ...
In this paper, we focus on static overloading in Featherweight Java, which is resolved at compile time based on the types of the...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
If at compile time you can’t confirm that your object is of type INotification then you wouldn’t be able to use publish. Without the constraint you can
Is there any reason why I should not use one of the following?
or