Returning anonymous types

  • Thread starter Thread starter Bill McCormick
  • Start date Start date
B

Bill McCormick

I have a Linq2Sql join statement in a property that I want to project
into entity sets to return from the get, so that the changes to the
result can be persisted.

Is there some canonical form of returning anonymous types? I found this:

http://msdn.microsoft.com/en-us/library/bb397696.aspx

but it seems to suggest more than one solution. What are others doing?

TIA

Bill
 
I have a Linq2Sql join statement in a property that I want to project
into entity sets to return from the get, so that the changes to the
result can be persisted.

Is there some canonical form of returning anonymous types? I found this:

http://msdn.microsoft.com/en-us/library/bb397696.aspx

but it seems to suggest more than one solution. What are others doing?

As that article says, anonymous types are really not intended for exposing
outside the method where they are used. If you need to do something like
that, just create a named type for the purpose and use that.

Pete
 
Back
Top