using System;
using System.Linq;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
using ScaffoldDemo.Model;

namespace ScaffoldDemo
{
    class Program
    {
        static void Main(string[] args)
        {
            using (var dc = new NorthwindContext())
            {
                var serviceProvider = dc.GetInfrastructure<IServiceProvider>();
                var loggerFactory = serviceProvider.GetService<ILoggerFactory>();
                loggerFactory.AddProvider(new SqlQueryLoggerProvider());

                Console.WriteLine(dc.Products.Count());
            }
            Console.ReadKey();
        }
    }
}
