The difference will be Function(invocation) invocation.ReturnValue = 99
is an inline function returning a Boolean
, where as invocation => invocation.ReturnValue = 99
is an inline function returning 99
and setting invocation.ReturnValue
to 99
.
If you're using a late enough version of VB.NET you can use Sub(invocation) invocation.ReturnValue = 99
unless WhenCalled
expects a return value.