-
-
Save armohamm/7e9f69965d5f4045e65e50c0d24d255c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
internal interface IExampleService | |
{ | |
Task VeryImportantWorkAsync(int additionalSecondsToWait); | |
} | |
internal sealed class ExampleService : IExampleService | |
{ | |
private readonly IImportantDataProvider _dataProvider; | |
public ExampleService(IImportantDataProvider dataProvider) | |
{ | |
_dataProvider = dataProvider; | |
} | |
/// <inheritdoc /> | |
public async Task VeryImportantWorkAsync(int additionalSecondsToWait) | |
{ | |
var timeToWait = _dataProvider.GetTimeToWait() + TimeSpan.FromSeconds(additionalSecondsToWait); | |
await Task.Delay(timeToWait); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment