18
I was servicing a system until I came across the following code:
object auth;
var authContext = HttpContext.Items.TryGetValue("SystemQueryContext", out auth);
var result = await _systemService.Metodo(auth as QueryContext);
I made the following change:
var authContext = HttpContext.Items.TryGetValue("SystemQueryContext", out object auth);
var result = await _systemService.Metodo(auth as QueryContext);
However, the Intellisense of Visual Studio offered me the following change:
_ = HttpContext.Items.TryGetValue("SystemQueryContext", out object auth);
var result = await _systemService.Metodo(auth as QueryContext);
I’ve never seen this _
being used, I tried to use it as variable and is not possible, so I would like to understand about this feature, in which cases can be used, what it does?
The idea was just to get to
if
but I hit enter without reading :D– Barbetta