Created
February 11, 2020 19:30
-
-
Save NikitaChizhov/07f6d762d1e23c99ee4e64eec96080d5 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