1

I'm looking for something simple so any monkey like me can understand and implement it easily. If it's possible i only want to see the SQL queries and no extra code or commentaries that could confuse me.

I'm using ASP.NET Core 3.1 and Entity Framework Core 3.1

1 Answer 1

3

How do i view the SQL generated by EntityFramework Core?

You can try to set Microsoft.EntityFrameworkCore to Debug in appsettings.json to log EF events.

"Logging": {
  "LogLevel": {
    "Default": "Information",
    "Microsoft": "Warning",
    "Microsoft.Hosting.Lifetime": "Information",
    "Microsoft.EntityFrameworkCore": "Debug"
  }
}

Debug code and check the generated SQL query in Output window.

enter image description here

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.