views:

15

answers:

1

I have an entity data model and a domain service (it may be a RIA service - I don't know) like this:

[EnableClientAccess]
public class MyService : LinqToEntitiesDomainService<NORTHWNDEntities>
{
    public IQueryable<Categories> GetCategories()  
    {
        return this.ObjectContext.Categories;
    }  
}

From what I understand this class is on the server and the method GetCategoriesQuery() can be called from the client:

MyContext context = new MyContext();
IQueryable<Categories> p = context.GetCategoriesQuery();

I would like to receive from the server a projection of the Categories entity or maybe a join of some entities.

A: 

You mean, return an anonymous type from your method, from a projection? Then, no, because you can't return any anonymous type from a method. You'll have to define a class to project into to return it. Or you could return a Tuple<>.

Richard Hein