Entity Framework 4 + Silverlight persisting entity graphs -


we building our first large application silverlight 4 (using prism) , entity framework 4. i'm having general question persisting view model data. suppose have domain objects translate ef4 entities multiple associations (entity having collections, having collections again etc..). best way persist graphs during / after user actions? better write more granular repository methods "addentitytoparent" , "removeentityfromparent" or take data view , push "savelargeparententity" method? can "cache" view model items child objects in silverlight , push down ef4 later or have make granular update every single item changed in user interface? advise? hope question clear enough. thank you.

you making choice between basic crud operations , working object graphs. choose second approach because crud operations on web service can chatty.

when working object graphs send on web service have deal detached behavior. detached entities + object graph couses troubles when updating relations. best approach load whole graph before update (get attached entities) , merge received graph attached 1 - correctly track changes you.

but because using silverlight stateful can think using self tracking entities (ste). stes able track changes after detached ef objectcontext. can return object graph consisted of stes web service silverlight application, make changes stes , send same object graph web service. applying changes stes handle lot of work you. aware stes not best solution services should exposed general web applications or non .net clients.


Comments

Popular posts from this blog

python - Scipy curvefit RuntimeError:Optimal parameters not found: Number of calls to function has reached maxfev = 1000 -

c# - How to add a new treeview at the selected node? -

java - netbeans "Please wait - classpath scanning in progress..." -