views:

72

answers:

2

Do you know an ORM supporting this extension method:

public static IQueryable<TResult> Select<TSource, TResult>(
  this IQueryable<TSource> source, 
  Expression<Func<TSource, int, TResult>> selector)

Basically, it allows to add row number (index of result in sequence) to the projection. Example of its usage with IEnumerable is here. But the same method exists for IQueryable.

So I'm curious, is there any ORM tool that supports this method?

The question is actually related to this one.

A: 

You can certainly use it with LINQ to Entities. Since it's just icing over the standard Select, I would presume that any IQueryable provider which supports Select would also work with it.

Bear in mind, though: It's not the row number, as evidenced by the fact that it's an Int32. It's an index, which isn't the same thing.

Craig Stuntz
Actually I'm not as sure as you are: I didn't find any links so far approving this. But it seems a good idea to add test for this to ORMBattle. If this is approved, your answer will be accepted :)
Alex Yakunin
So the document you just posted to another my question (about list of supported IQueryable methods for EF) explicitly states this method isn't supported by EF: http://msdn.microsoft.com/en-us/library/bb738550(VS.100).aspx (see second item).
Alex Yakunin
I've certainly used it before, but can't think of a good way to search for it. It's certainly possible I went through `AsEnumerable` first. At any rate, it certainly *should not* be a row number no matter how you do it.
Craig Stuntz
Err... Do you mean it's desirable to avoid using row numbers? If so, that's true, and I know this.
Alex Yakunin
Yes, that's what I mean. I only brought it up because of what your question actually says.
Craig Stuntz
A: 

No examples, so most likely there is no such ORM.

Alex Yakunin
We've finally implemented this stuff in DataObjects.Net.
Alex Yakunin