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.
我知道 L2S并非 旨在将自定义/POCO 类型映射到没有对象初始化器语法的 L2S 实体类型。但是有没有一种背书方法来实现这一点,这样我就可以使用参数化构造函数投影到我的 POCO 中,而当我尝试将表达式应用于该结果时不会被刺痛?
在内存中执行 ToList() 并针对内存中的集合运行语句。
是的,当然它不如查询 L2S IQueryable 有效。但设计更简洁。
我以前也走过那条路。结果很糟糕。IQueryable 的 L2S 和 EF 实现除了它所设计的对象之外的任何东西都不能(很好地)工作。
你不能。
如果有“背书方式”,我还没有找到(我怀疑我不想)。