Nhibernate equivalent of LinqToEntitiesDomainService in RIA
- by VexXtreme
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