Click here to Skip to main content
15,923,689 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi in my program user insert product and set delivery time of product
i want to query my table record and find products that should devlivery next 24 hour
how can i do it?

What I have tried:

i try this but nothing work
var alaram = dbContext.products.where(x=> x.Deliverytime < DateTime.Noe).toList()
Posted
Updated 29-Nov-17 19:12pm

1 solution

var alaram = dbContext.products.where(x=> (x.Deliverytime - DateTime.Now).TotalHours <=24).toList();

Note : Deliverytime must be a datetime
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900