Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CSHARP

c# ilogger for inherited class

public abstract class BaseClassExample
{
    private readonly ILogger _logger;

    public class BaseClassExample(ILogger logger)
    {
        _logger = logger;
    }
}

public class DerivedClass : BaseClassExample
{
    private readonly ILogger<DerivedClass> logger;

    public class BaseClassExample(ILogger<DerivedClass> logger) :base(logger)
    {
        this.logger = logger;
    }
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #ilogger #inherited #class
ADD COMMENT
Topic
Name
9+1 =