>No. You can new up an existing type or an anonymous type - no other options. Well you could go down the DLR route (but I don't like it):
var anon = clients.Select(x => new { Surname = x.LastName, GivenName = x.FirstName }).FirstOrDefault();
>DoSomething(anon);
Then:
void DoSomething (dynamic d)
> {
> string Surname = d.Surname;
> }
(Sorry C# version but conversion should be simple)
Maybe I am not understanding it, but what I see here is some code to, in fact, add the property in the returned object instead of the sub object itself. But, in order to accomplish this, this code seems to execute a method after the initial query and adjust to include an additional property. But, the initial query would still return all the fields, correct? If that is the case, as some of it is an object, isn't that object be returned as well in that query? Or, is it that it will only become available from a secondary call made to the object result, which will go again across the wire to get the sub object?