Created
September 4, 2021 13:48
-
-
Save WolfgangOfner/04460542cc2df22c7eb64fc323ee4d2d 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
using System.Collections.Generic; | |
using System.Threading; | |
using Microsoft.Extensions.Logging; | |
namespace DecoratorPattern.Services | |
{ | |
public class DataService : IDataService | |
{ | |
private readonly ILogger<DataService> _logger; | |
public DataService(ILogger<DataService> logger) | |
{ | |
_logger = logger; | |
} | |
public List<int> GetData() | |
{ | |
var data = new List<int>(); | |
for (var i = 0; i < 10; i++) | |
{ | |
_logger.LogInformation("Log something"); | |
data.Add(i); | |
Thread.Sleep(350); | |
} | |
return data; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment