I have an EF6 ObjectContext containing a largish number of ObjectSets.
One EntityObject in particular has over a hundred properties, including some large text fields.
I have several forms to work with, that work with different pieces of the data.
Rather than have to load the entire object definition, is there a way I can define a "new" EntityObject that contains the primary key, timestamp, and a half dozen text fields, so that only those fields get pulled from the database?
I'm asking this because I've already got a databinding, validation and update pattern already built up for this, and I'd rather not have to build a second one to go alongside it.
I'm not sure if this is what you need, Hope it helps
1- Define a new class with the properties you want to store
2- write your sql/linq query to pull the fields you want from your db..
Say your table with over 100 properties is
USERStable, now define another classyour query:
then store it in the defined class like this:
Note: selected query types and names should match with the defined class in order for this to work.
after you do this set your databindings accordingly but you will need to manually handle data validation and other stuff