My use case is as follows.
Given a DB backed entity like Player
class Player() { Guid UniqueID { get; set; } string FirstName { get; set; } string LastName { get; set; } bool IsActive { get; set; } string TeamName { get; set; } string Position { get; set; } byte[] Picture { get; set; } }
|
And a POCO class for a query on Players to project into:
class PlayerLite() { Guid UniqueID { get; set; } string LastName { get; set; } bool IsActive { get; set; } }
|
I need to query many objects like Player at once. to make the query more performant I've used a POCO to only pull down the data I need to interact with. In reality my Player table is much larger than this. And I'd like to avoid pulling down heavier properties like Images and other Navigation Properties.
In the portion of the app this is used for the User is only ever expecting to modify a handful of properties for a given Player entity.
I guess I don't understand the function of wanting to save the POCO to somewhere that is not it's data source, like an XML file. To me this sounds like I could query for a subset of the object I wanted to modify, make a few changes, and be able to map the properties on the POCO back to the DB backed Entity.
Is there another way you'd suggest doing this?