C # 6.0 adds a new operator ?. , which now allows triggering such events:
someEvent?.Invoke(sender, args);
Now, from what I read, this statement ensures that someEvent is evaluated once. Is it correct to use this type of call instead of the classic template:
var copy = someEvent if(copy != null) copy(sender, args)
I know certain scenarios where the above version of the template will require additional locks, but the simplest case is permissible.
source share