Last post Apr 05, 2014 03:11 AM by damienBod
Apr 03, 2014 09:42 AM|gdogg|LINK
I have Web API method that calls another method marked with async used to update a database (using EF 6). I do not need to wait on the db method to complete (its fire and forget), hence I do not use
await when calling this async method. If I do not call await, the db method throws an NullReferenceException that is never passed to my code, and just shows up as a first chance exception in the output window of VS2013.
What is the proper way to handle calling an async method without await-ing?
Apr 05, 2014 03:11 AM|damienBod|LINK
You should call await for this method as you require the result when the method is finished. The method itself should also be async so that the calling client does not have to wait. Due to this, you do not require an async database method as the calling
controller method is async anyway.