c# - What happens when calling an async method without await? -


I wonder what happens if I call the method that is marked as ASCIN, Without waiting Consider this example:

  Private Ent ID = 0; Async Task Initiative () {var content = Wait LoadFromDisk (ID); Awaiting the process (content); Return; } DataInnd {Return id; } Set {id = value; Start (); }}  

I know that it will produce a compilation warning, but my question is that if the call is awaiting an initial call then still it will work as one would expect As you can see, it is not necessary to wait for setter to start () as there is no return value and it is the last call to the setter of the property, it is like a fire and forgets.

The reason for this is that I would like to add MVVM and a data backend which forces me to use asynp systems.

The above example, the user selects an entry from the list and should display detailed information about the entry in the second part of the program.

I would like to bind the current selected entry of the list DataId which whenever the user selects the change, updates the details. Of course, it would be possible to call async method from an event handler, but I would like to avoid event handlers for a cleaner MVVM implementation (mostly using databasing).

If you call a async job method without waiting for the job, Then with that exception no exception will be taken into consideration silently. If you call the async zero method (which you specify in the title of your question, but not is your code), then with no exception from that method Will be raised again Synchronization Context - In this case, the UI is sent directly to the main loop.

I have a blog post, which is presented in the previous section, which is typically asynchronous data binding.


Comments