I am returning a List (native class) from Silverlight to the service, there are old objects with updated values and completely new entities in this list, how can I save this back to the database using the entity structure?
Using cEnts.CardItems.AddObject gives me obviously duplicates.
You want to use Attach () instead of AddObject ().
Attach will take your disconnect object and inform the container of this for updating. New objects will be added without PrimaryKey.
/, AddTo...() ApplyPropertyChanges .
, , . , , ( : http://www.abadjimarinov.net/blog/2009/12/13/AttachAlreadyChangedObjectToADataContextInEntityFramework.xhtml).
Source: https://habr.com/ru/post/1726202/More articles:How to iterate over a string using a buffer (python) - pythonGPS update rate - which is acceptable? - androidProblems with block alignment with IE7, how to solve them? - htmlFinding Distance GeoDjango - pythonFormatting a time period - javaHow to create a range of IP addresses? - phpVisual Studio 2008 ANSI C Restriction - cIsLoaded for self-control objects - entity-frameworkЧто это значит, когда в Mathematica синие слова выделены синим цветом? - wolfram-mathematicaA strange problem, Tomcat Webapp UTF-8 The character cannot be displayed correctly after every restart or every redistribution - tomcatAll Articles