Search
 
SCRIPT & CODE EXAMPLE
 

CSHARP

c# instance class with ilogger

public class MyController
{
    private readonly ILogger _logger;
    private readonly ILoggerFactory _loggerFactory;
    
    public MyController(ILogger<MyController> logger, ILoggerFactory loggerFactory)
    {
        _logger = logger;
        _loggerFactory = loggerFactory;
    }

    public ActionResult List()
    {
        ILogger<MyModel> modelLogger = _loggerFactory.CreateLogger<MyModel>();
        MyModel model = new MyModel(modelLogger);
    }
}
Comment

PREVIOUS NEXT
Code Example
::  
:: c#l list<string initialize 
Csharp ::  
::  
Csharp ::  
::  
::  
::  
::  
::  
::  
Csharp ::  
:: get gameobject active state 
Csharp ::  
::  
Csharp ::  
Csharp ::  
::  
::  
:: tilemap shader 
:: c# datagridview cell align center 
::  
Csharp ::  
Csharp ::  
::  
::  
::  
:: unity animation length 
Csharp ::  
:: float into int unoity 
ADD CONTENT
Topic
Content
Source link
Name
9+5 =