c# - Inline Lambda Expression in Watch Window -
i need write custom lambda expressions during debugging.
as example:
(new func<int, string>(x => $"{commandparameters[x].parametername} : {commandparameters[x].value}"))(2)
or shorter one:
(new func<int, string>(x => x.tostring()))(2)
or
((func<int, string>)(x => x.tostring()))(2)
i'd know simplest form can write such expressions can evaluated in watch
window.
omitting func
construction have (x => x.tostring())(2)
more readable won't evaulated due cs0149: method name expected
lovely candidates:
(x => x.tostring())(2)
((int x) => x.tostring())(2)
Comments
Post a Comment