Nhibernate equivalent of LinqToEntitiesDomainService in RIA

Posted by VexXtreme on Stack Overflow See other posts from Stack Overflow or by VexXtreme
Published on 2010-05-28T14:31:29Z Indexed on 2010/05/30 0:42 UTC
Read the original article Hit count: 674

Hi,

When using Entity Framework with RIA domain services, domain services are inherited from LinqToEntitiesDomainService, which, I suppose, allows you to make linq queries on a low level (client-side) which propagate into ORM; meaning that all queries are performed on the database and only relevant results are retrieved to the server and thus the client.

Example:

var query = context.GetCustomersQuery().Where(x => x.Age > 50);

Right now we have a domain service which inherits from DomainService, and retrieves data through NHibernate session as in:

virtual public IQueryable<Customer> GetCustomers()
{
    return sessionManager.Session.Linq<Customer>();
}

The problem with this approach is that it's impossible to make specific queries without retrieving entire tables to the server (or client) and filtering them there.

Is there a way to make linq querying work with NHibernate over RIA like it works with EF? If not, we're willing to switch to EF because of this, because performance impact would be just too severe.

Thanks

© Stack Overflow or respective owner

Related posts about c#

Related posts about Silverlight