Connoisseurs, please tell me how to check the execution of the method and after its completion run another method?
try { bool needUpdate = await _updater.CheckUpdateAsync(); if (needUpdate) { _updater.Update(); } } catch (Exception ex) { Logger.Current.AppendException(ex); } try { bool needUpdate = await _updater2.CheckUpdateAsync(); if (needUpdate) { _updater2.Update(); } } catch (Exception ex) { Logger.Current.AppendException(ex); }
The meaning is: If an update is required, start the procedure. But in this code I turn to two methods at once, how to implement type checking - if the method is executed, does the second method wait for the first one and only after it starts?