gpt4 book ai didi

C# Linq Where Date Between 2 Dates

转载 作者:IT王子 更新时间:2023-10-29 03:42:23 27 4
gpt4 key购买 nike

我正在尝试让我的 linq 语句获取两个日期之间的所有记录,但我不太确定我需要更改什么才能使其正常工作:(a.Start >= startDate &&结束日期)

var appointmentNoShow =
from a in appointments
from p in properties
from c in clients
where a.Id == p.OID && (a.Start.Date >= startDate.Date && endDate)

最佳答案

改成

var appointmentNoShow = from a in appointments
from p in properties
from c in clients
where a.Id == p.OID &&
(a.Start.Date >= startDate.Date && a.Start.Date <= endDate)

关于C# Linq Where Date Between 2 Dates,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2237440/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com