Last post Oct 28, 2014 03:21 AM by Mikesdotnetting
Oct 28, 2014 03:13 AM|mou_inn|LINK
is there any easy way to log all SQL generated by Entity Framework? i want to hook into EF in one place in such way that whatever we do like select or insert/update/delete etc then all sql generated by EF will be logged. please guide me if there is a way.
Oct 28, 2014 03:21 AM|Mikesdotnetting|LINK
You can use Command Interceptors for that. It's covered in this tutorial: http://www.asp.net/mvc/overview/getting-started/getting-started-with-ef-using-mvc/connection-resiliency-and-command-interception-with-the-entity-framework-in-an-asp-net-mvc-application