I want to reset password inside local function. Suddenly, i tried to run this local function from quick watch, but it didn't work.
Please help me out, if i am doing anything wrong. Thanks in advance.
I want to reset password inside local function. Suddenly, i tried to run this local function from quick watch, but it didn't work.
Please help me out, if i am doing anything wrong. Thanks in advance.
The compiler changes the name of the local function, preventing you from calling it using its original name from the debugger. See this question for examples. What you can do is temporarily modify the code to save a reference to the local function in a delegate variable. After recompiling, you can invoke the function through the delegate variable from Quick Watch or the Immediate Window. In your case, add this code to the beginning of the method:
Func<string,Task> f = ResetPasswordLocal;
Now you can invoke f
in Quick Watch.
I'll have to say that I haven't tried it and will not bother to do so because there's a lot more to local functions than you think and I would put it very low in terms of priority for the debugger.
Try putting your code in sharplab.io and see what it takes to make that local function.