Projection Question

Posts   
 
    
psandler
User
Posts: 540
Joined: 22-Feb-2005
# Posted on: 24-Jun-2006 17:01:13   

Hey Frans,

If you were creating DTOs for a webservice (for example), would it be possible to get the DTOs back from the webservice, convert them back to Entities and then save them?

I guess the root of the question is: are projections limited to read-only objects?

Thanks,

Phil

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39928
Joined: 17-Aug-2003
# Posted on: 25-Jun-2006 11:02:34   

No projections are limited to a known source simple_smile So 'entityview' or 'datareader'. So the conversion has to be done by you, unless you write a projection routine which consumes the projection interfaces defined and a DTO source and projects the data onto the target class using the projector specified. The projection routine used for projecting datareader data is stored in UtilityClasses.cs -> ProjectionUtils (it's an internal class but consult the sourcecode) and it's fairly straight forward. So if you for example define an interface on your DTO's which makes it easy to consume a set of them for projection, it's fairly easy to project their data using your version of that projection routine.

Frans Bouma | Lead developer LLBLGen Pro
psandler
User
Posts: 540
Joined: 22-Feb-2005
# Posted on: 25-Jun-2006 17:37:02   

Thanks Frans! I'll tinker around with this.