Query Projections in WCF Data Services


The MSDN documentation on the topic does a pretty good job at giving you a high-level view of what happens when you use select to do a projection of the query results, and calls out a number of things that aren't supported when projecting entity types. It looks like projecting into anonymous types is much more powerful - how come?


There is a very important principle that cost a lot of work to enforce, and that is that we'll try our best to make sure that you don't use projections in a way that loses data when updating. Big, huge thing for us. The following statement from the MSDN page should be read carefully.



When updates are made to a projected type that does not contain all of the properties of the entity in the data model of the data service, existing values not included in the projection on the client will be overwritten with uninitialized default values.


That said, I'll cover a few of the things that you can do with projected entity types that are quite useful and may not be obvious in the following posts.


Enjoy!

Comments (0)

Skip to main content