dotnet / dotnet/EntityFramework.Docs
Simple way to see SQL statements
- Dominant language
- Mermaid
- Stars
- 1.7k
- Forks
- 2k
- Avg merge
- 7d 23h
- Merged PRs (30d)
- 16
Description
In EF6 it was very simple to output the generated SQL with a one-line of code using Database.Logging property.
I tried to do everything discussed in this article as well as ASP.NET Core logging linked article, but it doesn't work.
Could you please provide a COMPLETE sample of how to see the EF generated SQL in a ASP.NET Core Web API?
Thanks.
---
#### Document Details
⚠ *Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.*
* ID: 40a1cdc0-8bda-0188-1231-35c1656ff6d1
* Version Independent ID: 79cfe1f9-1139-c191-8a4b-1697a9f23f23
* Content: [Overview of logging and interception - EF Core](https://docs.microsoft.com/en-us/ef/core/logging-events-diagnostics/)
* Content Source: [entity-framework/core/logging-events-diagnostics/index.md](https://github.com/dotnet/EntityFramework.Docs/blob/main/entity-framework/core/logging-events-diagnostics/index.md)
* Product: **entity-framework**
* Technology: **entity-framework-core**
* GitHub Login: @ajcvickers
* Microsoft Alias: **avickers**
Contributor guide
Assessment
This issue has not been assessed yet.