Why is this linq request:
(from c in Orders select new { Id=c.Id, DeliveryDate = c.DeliveryDate.Value }).Take(10)
translates to
SELECT TOP (10) [t1].[Id], [t1].[value] AS [DeliveryDate] FROM ( SELECT [t0].[Id], [t0].[DeliveryDate] AS [value] FROM [Orders] AS [t0] ) AS [t1]
but when I change DeliveryDate = c.DeliveryDate.Value
to DeliveryDate = c.DeliveryDate
, the SQL query looks as simple as:
SELECT TOP (10) [t0].[Id], [t0].[DeliveryDate] FROM [Orders] AS [t0]
source share