How do I view the SQL generated by the Entity Framework?

后端 未结 22 2875
别那么骄傲
别那么骄傲 2020-11-21 05:35

How do I view the SQL generated by entity framework ?

(In my particular case I\'m using the mysql provider - if it matters)

22条回答
  •  悲哀的现实
    2020-11-21 06:13

    IQueryable query = from x in appEntities
                       where x.id = 32
                       select x;
    var queryString = query.ToString();
    

    Will return the sql query. Working using datacontext of EntityFramework 6

提交回复
热议问题