Skip to content

Instantly share code, notes, and snippets.

@armohamm
Forked from NikitaChizhov/ExampleService.cs
Created February 11, 2020 20:08
Show Gist options
  • Save armohamm/7e9f69965d5f4045e65e50c0d24d255c to your computer and use it in GitHub Desktop.
Save armohamm/7e9f69965d5f4045e65e50c0d24d255c 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