c# - Comparing a DateTimeOffSet From DataBase to Current Value -
what want simple. if datetimeoffset of created event older 24 hours want removed database. having huge amount trouble working converting system.linq.iqueryable system.datetime . any appreciated. index of events public actionresult index() { iqueryable<datetimeoffset> b = db.events.select(x => x.eventtime); datetimeoffset currentdate = datetimeoffset.now; if (currentdate > b) { db.events.remove(@event); db.savechanges(); return view(db.events.tolist()); } return view(db.events.tolist()); } my other question how structure requires 24 hour difference in order remove row database. the data table has eventtime datetimeoffset data type. i have been trying use datetimeoffset.compare(currentdate, b); but visual studio isn't liking line well. please if know how compare time database current time. there nothing in regards on site. have spent day on site , have yet find along this. thanks it might ea