If you want to check the final SQL query generated by Entity Framework based on the LINQ expression for MySQL database . you can follow the following steps :
1. Connect to your MySQL command line
2. run the following command : SET GLOBAL general_log = 'ON';
3. In next command you need to setup the log file location. Here is the command for that SET GLOBAL general_log_file = 'C://file.log';
4. Execute the method for which you want to check the SQL query.
5. Once you are done SET GLOBAL general_log = 'OFF'; run this.
You can now check in your log file the output sql query from Entity Framework .
No comments:
Post a Comment