Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
有人可以建议我在哪里出错:
var results = CurrentPage.Children.Where("raceDate >= DateTime.Now").OrderBy("raceDate");
在 Umbraco v5.1 RC 中,我尝试创建日期为今天或之后的项目集合,但出现以下错误:
Operator '>' incompatible with operand types 'Object' and 'DateTime'
你需要做这样的事情(未经测试):
ults = CurrentPage.Children.Where("raceDate >= @0", DateTime.Now).OrderBy("raceDate");
按照您编写的方式, datetime.now 不会被替换到 where 子句中。