© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•3y ago•
4 replies
user68721489

❔ Assign result from await to a variable

Is there a difference between those two calls?

var awaitable = await GetObject();
otherObject.IntProperty = awaitable.IntProperty;

// vs.

otherObject.IntProperty = (await GetObject()).IntProperty;
var awaitable = await GetObject();
otherObject.IntProperty = awaitable.IntProperty;

// vs.

otherObject.IntProperty = (await GetObject()).IntProperty;
C# banner
C#Join
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
61,871Members
Resources
Recent Announcements

Similar Threads

Was this page helpful?

Similar Threads

✅ cant assign a value to a variable
C#CC# / help
2y ago
❔ assign a local string function to a string variable
C#CC# / help
4y ago
Auto-translation, HttpClient, Result, await...
C#CC# / help
3y ago
Can't assign private variable (Unity)
C#CC# / help
14mo ago