Wrenpo
Safely getting a result from a async method within a sync method
Sorry, was busy at work and didn't get back to this. Thank you for all the responses!
I am aware of the deadlocking possibilities and have read up on some of Stephen Cleary's articles about this including his SO answers to similar questions. I have since converted my async method into a synchronous one. I am running into a situation now where the remote server is closing the request early. I am working with Azure AD B2C and .NET Framwork 4.8. Inside our middleware (OWIN), a synchronous method is establishing the initial connection with Azure AD B2C to identify a user and allow them into the app. However, what this does not handle is giving back the refresh token. It was assumed that it did this automatically. It does not. It disposes it and does not store it anywhere. So, I have been manually trying to do this from what was originally my async method. I can take my authorization code that I get from B2C and with a request body, send a GET over to the token endpoint on Postman and get what I want. I am going a bit crazy trying to get this working from the app.
37 replies
How to start coding C# in vs code??
You need the .NET SDK
https://dotnet.microsoft.com/en-us/download/visual-studio-sdks
3 replies
Studying singly linked lists and need help understanding pointer functionality
Car
and ListNode
are objects and go on the heap, including their properties. The local variables myCar
, newCar
, dummy
, and current
are on the stack. When I code current.next
or myCar.IsRunning
, I am referring to the heap object and not the local variable?18 replies
Studying singly linked lists and need help understanding pointer functionality
So I guess the following would be true if my understanding is correct:
Basically, if I change the new object that references the previous object to a new object or null, only the new object changes.
However, in the original code block, during the while loop,
current.Next
still updates the links between the nodes. Is this because the property is the same as the object?18 replies
Studying singly linked lists and need help understanding pointer functionality
What documentation can I look up to learn more about this? When doing searches around variables, pass-by-value, pointers, addresses, I get thrown a lot of info about pointers in the literal sense like
int* ptr
.18 replies
Studying singly linked lists and need help understanding pointer functionality
I think I am following. I am guessing that
current
and dummy
are stored in different memory and that's why changing one does not overwrite the other. With dummy
being initialized to a val = 0
from the ListNode constructor, why does dummy not keep that val when creating the chained nodes?18 replies
Studying singly linked lists and need help understanding pointer functionality
I guess what is breaking my brain is the following:
- I set current = dummy (current is now the object dummy instead of just a copy)
- I set current.next = temp (dummy.next now equals temp and so does current.next)
- I set current = temp (why does temp not replace dummy as a whole since setting current.next changes dummy.next?)
18 replies