Created
February 11, 2020 19:46
-
-
Save NikitaChizhov/42f8b19f0007f8d1183bdc88090292e8 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 sealed class ExampleServiceClassicDecorator : IExampleService | |
{ | |
private readonly IExampleService _decorated; | |
private readonly ILogger<ExampleServiceClassicDecorator> _logger; | |
public ExampleServiceClassicDecorator(IExampleService decorated, | |
ILogger<ExampleServiceClassicDecorator> logger) | |
{ | |
_decorated = decorated; | |
_logger = logger; | |
} | |
/// <inheritdoc /> | |
public async Task VeryImportantWorkAsync(int additionalSecondsToWait) | |
{ | |
_logger.LogInformation("Log something before method call"); | |
await _decorated.VeryImportantWorkAsync(additionalSecondsToWait); | |
_logger.LogInformation("Log something after method competition."); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment