Convert code to utility or extension method
Is it possible to simplifing this piece of code with some static utility or extension method?
5 Replies
I cannot do this
OK, it looks like it's simply against to rules to do what you're trying. Why is
t
a ref
parameter when you could maybe use the return value of NullifyOnKill
and assign that to whatever t
is in the calling code? Just a guessI want to nullify that passed variable, that's why it's passed with
ref
keywordI know that but you can't do that in a lambda, is why I'm proposing you don't pass the variable but use the return value instead and assign that return value to whatever you previously would have passed
You need to create a delegate
After that you can use ref t