Skip to content

Instantly share code, notes, and snippets.

@Ibro
Last active January 18, 2020 09:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Ibro/7518d949a842785d64a8fdd898f29de3 to your computer and use it in GitHub Desktop.
Save Ibro/7518d949a842785d64a8fdd898f29de3 to your computer and use it in GitHub Desktop.
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