ILogger
Startup.cs
public void ConfigureServices(IServiceCollection services) { string connectionString = Configuration.GetConnectionString("DbConnection"); services.AddDbContext<AppDbContext>(options => options.UseSqlServer(connectionString)); services.AddControllersWithViews(); services.AddScoped<IBooksService, BooksService>(); services.AddScoped<IBooksRepository, BooksRepository>(); }
public BookController(IBooksService booksService, ILogger<BookController> logger) { _booksService = booksService; _logger = logger; }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)