I have the following table :
Indicators(A INT, B INT, C INT, D INT, TimeInsertedLocal DateTime) .
And I have the EF Core mapping entity that maps to this table.
I need to translate this SQL query to ef core Linq equivalent query .
SELECT A, B, C, D, TimeInsertedLocal
FROM Indicators
WHERE TimeInsertedLocal >=
(
SELECT MAX(I.TimeInsertedLocal)
FROM Indicators AS I
)
and this is the entity :
public class Indicator
{
public int A { get; set; }
public int B { get; set; }
public int C { get; set; }
public int D { get; set; }
public DateTime TimeInsertedLocal { get; set; }
}
How to write the LINQ query so that EF Core generate the same query or a better query that achieves the same result?