Using context.Database.Log in MVC web app

前端 未结 3 1844
我在风中等你
我在风中等你 2021-01-17 21:47

Using the guide here, I\'m trying to log the SQL generated by my MVC web application.

The guide uses the line:

context.Database.Log = Console.Write;
         


        
3条回答
  •  轮回少年
    2021-01-17 22:17

    You can print it in Debug window:

    dbContext.Database.Log = message => Debug.Write(message);
    

提交回复
热议问题