I have this LINQ query:
from device in _context.Device
from data in _context.Data.OrderByDescending(_ => _.Time).Take(1)
select data;
I use it with .NET5 EF, and I have navigation properties.
Device looks like this:
Device
------------
DeviceId int (Primary key)
DeviceInformation varchar(max)
...
Data looks like this:
Data
------------
DataId int (Primary key)
DeviceId int (Foreign key for Device)
Time datetime
...
How can I convert it as a lambda query?