>>When using EF 4, MM 4, VS2010 and the following LINQ query in MM biz tier,
>>
>> IQueryable<ClientEntity> query = from o in this.ObjectContext.ClientEntities
>> select o;
>> return this.GetEntityList(query);
>>
>>what is the syntax to bring back a subset of fields,
>>select new {o.FirstName, o.LastName}; doesn't work; however, the foreach analysis does, but that is not what I want to return.
>>It gives me an error that I am trying to implicitly cast an anonymous type to my 'MM entity' type and implies that there is a specific cast for this, I don't know what this would be. I really don't want to bring back a large number of fields when I only need a few. Maybe I have to build a separate EF class for just this purpose but it seems like a waste. I couldn't find anything on this in the MM Guide.
>>Thanks for any help!
>
>You could simplify this and use Stored Procedure that only returns what you want. This is more of an Linq to Entity question than a MM one I think. Maybe someone with more Linq experience will jump in and give you the syntax needed.
>Tim
from o in this.ObjectContext.ClientEntities.Select(o=>new {myfield = o.datafield, myfield2 = o.datafield2});