TodayCheckedStatus = (from checkinout in context.Checkinout
join status in context.Status on checkinout.CheckType equals status.Statusid
where checkinout.Userid == userinfo.Userid
where checkinout.CheckTime == DateTime.Today.Date
orderby checkinout.CheckTime descending
select new Checkinout
{
CheckStatus = status.StatusText,
CheckTime = checkinout.CheckTime
}).ToList()
我使用了它,但是由于不起作用,它在页面中什么也没显示
where checkinout.CheckTime == DateTime.Today.Date
答案 0 :(得分:0)
只需重申@ikerbera的回答,所需的更改就是
where checkinout.CheckTime.Date == DateTime.Today.Date