Skip to content

Instantly share code, notes, and snippets.

@Ibro Ibro/MyScopedService.cs
Last active Jan 18, 2020

Embed
What would you like to do?
ASP.NET Core DI
public class MyScopedService : IMyScopedService
{
private readonly ILogger<MyScopedService> _logger;
public MyScopedService (ILogger<MyScopedService> logger)
{
_logger = logger;
}
public void DoSomething ()
{
_logger.LogInformation ($" { nameof(MyScopedService) } does something ");
}
}
public interface IMyScopedService
{
void DoSomething ();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.