gpt4 book ai didi

linq - .AsExpandable in Linq to Entity

转载 作者:行者123 更新时间:2023-12-03 14:56:23 26 4
gpt4 key购买 nike

在 Linq to Entity 中,.AsExpandable() 做什么?到底怎么办?在哪里以及为什么使用它?它是否将所有相关实体都包含在查询中以进行延迟加载?

最佳答案

Entity Framework's query processing pipeline cannot handle invocation expressions, which is why you need to call AsExpandable on the first object in the query. By calling AsExpandable, you activate LINQKit's expression visitor class which substitutes invocation expressions with simpler constructs that Entity Framework can understand.
Josef Albahari



有关更多详细信息,我建议阅读 author of LinqPad

关于linq - .AsExpandable in Linq to Entity,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30667858/

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