Quantcast
Channel: Entity Framework
Viewing all articles
Browse latest Browse all 10318

New Post: Using the 'LIKE' operator inside a Lambda Expression

$
0
0

In my Entity (Sale) has a type of DateTime column Date.

I used following lambda expression to get the latest TrNo from that table. But always it gives me Null. Because it also compares the Time part of the column. Actually I wanted to compare the Date part of the column.

db.Sales.OrderByDescending(O => O.Date).Where(O => O.Date == DateTime.Now ).Select(O => O.TrNo).FirstOrDefault();

Please help me to get the build the right code. (My db is MySQL)

Thanks!


Viewing all articles
Browse latest Browse all 10318

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>