Skip to content

Instantly share code, notes, and snippets.

@NikitaChizhov
Created February 11, 2020 19:30
Show Gist options
  • Save NikitaChizhov/07f6d762d1e23c99ee4e64eec96080d5 to your computer and use it in GitHub Desktop.
Save NikitaChizhov/07f6d762d1e23c99ee4e64eec96080d5 to your computer and use it in GitHub Desktop.
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