I have a sync method as below:
public ActionResult Insert([FromBody] Model model) { } and I also have an async method:
_myMethodAsync(); My async method returns int. If I do like this I have to edit everything
public async Task<ActionResult> Insert(...){ ... await _myMethodAsync(); ... } Normally when I add without await I get wrong results.
public ActionResult Insert([FromBody] Model model) { //... _myMethodAsync(); //... }
_myMethodAsync().GetAwaiter().GetResult();