How to get sql from a efcore sentense?

mc 3,641 Reputation points
2022-08-06T08:09:44.893+00:00

What I want to do is create a conventor from efcore to sql.

for example.

I have entity:MyStudent

DbSet<MyStudent>MyStudents{get;set;};  

and there is a textblock.

I enter a sentence of efcore.

var query=await _context.MyStudents.AsNoTracking().Where(x=>x.Id==10);  

I can get the sql:

SELECT ID,NAME FROM MyStudent WHERE Id = 10;  

help me please.

Entity Framework Core
Entity Framework Core
A lightweight, extensible, open-source, and cross-platform version of the Entity Framework data access technology.
697 questions
0 comments No comments
{count} votes

0 additional answers

Sort by: Most helpful