I am trying to create a WCF Data Service that returns objects that look somewhat like my POCOs; they differ insofar as they have a single property which is computed when a query is called.
In other words say I have a POCO Film. I want to be able to query for Films which gives me Films with each with an added property ‘IsAllowedToWatch’. The value of ‘IsAllowedToWatch’ is determined by my authentication state and the number of users currently watching that film.
I’m using Code-First EF4 and WCF Data Services. Can anyone suggest the best way of doing this?
I’ve solved this problem but the solution was rather convoluted. I had to employ a custom IQueryProvider that mediated between my custom business type and the database type. It all got rather ugly!