© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•2y ago•
5 replies
Stefanidze

Can i use async/await in class constructors?

I want my class constructor to send data to the database, so every instance of the class is synced with the corresponding item in the database. The problem is that database uses async, and i want to wait for the database to process the request, to output unique id, for me to use it later. Is there any way i can do that?
C# banner
C#Join
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
61,871Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

Where i should use async await?
C#CC# / help
14mo ago
Async/Await question
C#CC# / help
2w ago
Async await in minimal API
C#CC# / help
2y ago
Using async,await in old codebase
C#CC# / help
4y ago