I have a list of objects with a DateTime parameter.
I would like to use LINQ to query this list and return entries by date but ignoring the Time portion
So I would like to select any entry that occurs at any time on 08-10-2012.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You can use this snippet for in-memory queries:
For querying against SQL Server data source, you can use
SqlFunctions.DatePartto extract the day, the month, and the year, and compare them separately.