Skip to content
Discussion options

You must be logged in to vote

The first thing that jumps at me when I look at the code you posted is that you invoke an asynchronous method (GetParticipantsAsync in this case) but you do not await the result. The consequence of this is that your participants variable contains a non-completed task
rather than the data you expect and therefore it explains why you are getting an exception about converting a Threading.Task to another data type.

Furthermore, when you await an async method, it's considered best practice to configure the synchronization context by invoking .ConfigureAwait(false) which is missing from your code sample. Please note that this is not mandatory, but highly encouraged.

The next thing that is impor…

Replies: 4 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@Jericho
Comment options

Answer selected by whampt
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants