从.net核心LinqKit获取生成的SQL

时间:2019-04-11 14:20:56

标签: entity-framework-core linqkit

关于 LinqKit.Microsoft.EntityFrameworkCore v1.1.16

的使用

我读到这应该和query.ToString();一样简单。但这似乎在.Net core 2.2中不起作用。您只会得到像;;这样的反射字符串。

  

“ Microsoft.EntityFrameworkCore.EntityFrameworkQueryableExtensions + IncludableQueryable`2 [Entities.Models.Contact,Entities.Models.Email]”

            Microsoft.EntityFrameworkCore.Query.IIncludableQueryable<Contact,Entities.Models.Email> query = Context.Contact
          .AsExpandable()
          .Include(c => c.BusinessContact).ThenInclude(b => b.BusinessContactType)
          .Include(c => c.ContactAddress).ThenInclude(ca => ca.Address)
          .Include(c => c.ContactTelephone).ThenInclude(ct => ct.Telephone)
          .Include(c => c.ContactEmail).ThenInclude(ce => ce.Email);

0 个答案:

没有答案