输出EF Core生成的SQL语句到控制台。A library outputing EFCore's SQL to the console.
-
Install the package from nuget:
Install-Package EFCore.Extension.Logger -Version 1.0.0
-
Override the method OnConfiguring in your DbContext class file:
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
{
optionsBuilder.UseEFCoreLogger();
base.OnConfiguring(optionsBuilder);
}