@jjx 呃,列表解析的语法就是python的语法。。。比如 [c for c in Customer] ,其中Customer就可以是一个list。
个人感觉python的列表解析还是非常接近日然语言的,而Linq差不多就是翻版SQL,不好理解。
比如顶楼那个例子:
python:
select(c for c in Customer if sum(c.orders.price) > 1000)
SQL:
SELECT "c"."id" FROM "Customer" "c" LEFT JOIN "Order" "order-1" ON "c"."id" = "order-1"."customer" GROUP BY "c"."id" HAVING coalesce(SUM("order-1"."total_price"), 0) > 1000