English 中文(简体)
ORM 能够处理循环的ORM
原标题:What ORM can handle recursion

我使用 C# ASP. NET, 并需要通过应用程序来使用循环。 我目前使用 Linq 给实体,并在网上进行广泛搜索,但无法找到和大意地进行循环查询。 我不知道循环会达到多少个级别 。

问题回答

我有一个类似的问题要解决,我最后写了一个助手函数,该函数会从我的数据源中反复出现,并按顺序返回一个包含所有项目的IE倍数。然而,就我而言,数据源是线性。如果你的树结构更像树结构,并且必须按等级显示,这将不起作用。

我不知道你到底有什么问题 我不知道其他ORMs在做什么

我认为Nhembernate应该解决 大部分的问题 直接向前。

  • Use Lazy-loading: children are lazily loaded. You don t need something like recursive queries, which are not possible in SQL.
  • Navigation with lazy loading works in both directions. So you can get a node from the database using a simple query and navigate to its parent.
  • In many cases it makes sense to add some additional redundancy to the recursive graph. For instance a reference to the root node, which allows queries to trees which have at least one node matching a criterion. Or the depth of a node (its distance to the root). Or the number of child nodes and so on. Whatever you need for your queries.




相关问题
Anyone feel like passing it forward?

I m the only developer in my company, and am getting along well as an autodidact, but I know I m missing out on the education one gets from working with and having code reviewed by more senior devs. ...

NSArray s, Primitive types and Boxing Oh My!

I m pretty new to the Objective-C world and I have a long history with .net/C# so naturally I m inclined to use my C# wits. Now here s the question: I feel really inclined to create some type of ...

C# Marshal / Pinvoke CBitmap?

I cannot figure out how to marshal a C++ CBitmap to a C# Bitmap or Image class. My import looks like this: [DllImport(@"test.dll", CharSet = CharSet.Unicode)] public static extern IntPtr ...

How to Use Ghostscript DLL to convert PDF to PDF/A

How to user GhostScript DLL to convert PDF to PDF/A. I know I kind of have to call the exported function of gsdll32.dll whose name is gsapi_init_with_args, but how do i pass the right arguments? BTW, ...

Linqy no matchy

Maybe it s something I m doing wrong. I m just learning Linq because I m bored. And so far so good. I made a little program and it basically just outputs all matches (foreach) into a label control. ...

热门标签