LINQ中的Oracle CONNECT BY PRIOR等效项? [英] Oracle CONNECT BY PRIOR equivalent in LINQ?

查看:110
本文介绍了LINQ中的Oracle CONNECT BY PRIOR等效项?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何使用LINQ实现Oraclel的CONNECT BY PRIOR输出?基本上我需要使用LINQ的层次结构和级别吗?

How to achieve Oraclel's CONNECT BY PRIOR output using LINQ? Basically i need the hierarchy and level using LINQ?

推荐答案

没有一个. LINQ对递归查询没有特殊支持.

There isn't one. LINQ does not have special support for recursive queries.

您可以使用的一种方法是编写一个方法,该方法使用LINQ查询获取顶层信息,然后编写一个递归调用自身的方法,以获取到目前为止收到的每个项目的子级.这可能会导致很多小的LINQ查询,而这些查询可能不是必需的.

An approach you can use is to write a method that fetches the top level using a LINQ query, then a method that calls itself recursively to get the children for each of the items received so far. This can result in a lot of small LINQ queries which might not be desiarable.

另一种方法是使用包含递归查询的存储过程,然后使用LINQ调用该存储过程.

A different approach is to use a stored procedure containing a recursive query and call that using LINQ.

这篇关于LINQ中的Oracle CONNECT BY PRIOR等效项?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆