Add support for Future() with the new Linq provider

Description

It would be nice if the Linq provider could support the Future functionality.

Environment

None

Activity

Show:

OrenE October 7, 2010 at 4:56 PM

Very good point, the impl has changed.

Diego Mijelshon October 7, 2010 at 2:18 PM

Oren,

I was referring to the ToFuture and ToFutureValue methods:

public static IEnumerable<T> ToFuture<T>(this IEnumerable<T> query)
{
var nhQueryable = query as NhQueryable<T>;
if (nhQueryable == null)
throw new NotSupportedException("You can also use the AsFuture() method on NhQueryable");

They can return IEnumerable<T>, no problem there, but they should take IQueryable<T>, since they only support a NhQueryable<T> as a parameter anyway.

Otherwise, you'll see the extension methods even in strings or any other enumerable, i.e. "Yada Yada".ToFuture() will compile.

OrenE October 7, 2010 at 10:21 AM

Diego,

Because if I would implement them on IQueryable, they wouldn't be executed.

Consider:

var people = s.Query<Person>().AsFuture(); <-- on queryable

var users = s.Query<User>().AsFuture(); <-- on queryable

people.ToList(); <-- users never had the chance to execute the AsFuture()!

Diego Mijelshon October 7, 2010 at 10:17 AM

I'm curious, why did you implement the extension methods on IEnumerable<T> instead of IQueryable<T>?

OrenE October 7, 2010 at 9:26 AM

You can now use: ToFuture() and ToFutureValue() extension methods in order to use future values from NHibernate.

Fixed

Details

Assignee

Reporter

Components

Fix versions

Affects versions

Priority

Who's Looking?

Open Who's Looking?
Created August 28, 2010 at 11:41 AM
Updated December 4, 2010 at 3:38 PM
Resolved October 7, 2010 at 9:26 AM
Who's Looking?