I have this query: select lower(Name) from User
How to make the same with linq to EF avoiding to user linq to object.
var query = context.Users.Select(u => u.Name.ToLower());
Entity Framework can translate String.ToLower into SQL. This query will be translated as:
SELECT
LOWER([Extent1].[Name]) AS [C1]
FROM [dbo].[Users] AS [Extent1]
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With