保存 Linq 查询并在从逻辑删除恢复时使用

发布于 2024-12-21 05:33:29 字数 294 浏览 4 评论 0原文

我有一个包含 500 个要查询的对象的 List 。在进行逻辑删除时,我不想将这 500 个对象保存到 State,而是想保存查询本身,以便在返回时,我可以将其插入到显示 500 个对象的查询的类中。

因此,如果我有 Dim pictures = (From s In p.AllPicturesWhere s.IsFavorite = True Order By s.Index Ascending).ToList,我怎样才能将查询本身保存到 State 以便从逻辑删除返回后我可以将该查询分配给图片

I have a List of 500 objects that are queried against. When tombstoning, rather than save those 500 object to State, I'm wanting to save the query itself so that upon returning, I can just plug that into my class that shows the query of the 500 objects.

So if I have Dim pictures = (From s In p.AllPictures Where s.IsFavorite = True Order By s.Index Ascending).ToList, how can I save just the query itself to State so that upon returning from tombstoning I can assign that query to pictures?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

铁轨上的流浪者 2024-12-28 05:33:29

您无法保存查询,因为查询是代码而不是数据。您可能的意思是分配查询的结果?

只需将 pictures 变量保存到 State 而不是 p.AllPictures 即可。

You can't save a query per say, as the query is code and not data. You probably mean to assign the result of the query?

Simply save your pictures variable to the State rather than the p.AllPictures.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文