This is a migrated thread and some comments may be shown as answers.

Tracking entity modifications in silverlight 4

1 Answer 36 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
madladuk
Top achievements
Rank 2
madladuk asked on 06 Oct 2010, 11:46 AM

Hi all. Done some reasearch on this however if you track the changes on the server, in order to use the originavalues then you need to switch on ConcurrencyMode which is okay however when data is updated it uses every concurrency field selected in the where clause which could cause problems with mulitple updates.

Therefore I am trying to track the changes within the silverlight client using the submittingchanges event. From here I can find out what entities have been modified using the change set and get the original values. What I am sturggling on now is how to compare the values.

When in debug mode I can view the method ModifiedProperties, however cannot get the solution to compile if I use this in code. The modifiedproperties shows the actual fields that have changed which is perfect as you dont have to loop the whole entity object; Code so far' As you can see the ModifiedProperties [in bold] will not compile however when viewing this in VS2010 debugger I can then use the method.

var changes = e.ChangeSet.ModifiedEntities;

foreach (var change in changes)

{

System.Reflection.PropertyInfo modified = change.ModifiedProperties();

 

}

The type when using it in the debugger is; {System.Linq.Enumerable.WhereListIterator<System.Reflection.PropertyInfo>} System.Collections.Generic.IEnumerable<System.Reflection.PropertyInfo> {System.Linq.Enumerable.WhereListIterator<System.Reflection.PropertyInfo>}

1 Answer, 1 is accepted

Sort by
0
madladuk
Top achievements
Rank 2
answered on 06 Oct 2010, 03:58 PM

Ok think I have sorted it, check my blog link for the details.

http://codingbites.blogspot.com/2010/10/auditing-entity-changes-in-silverlight.html

Tags
General Discussions
Asked by
madladuk
Top achievements
Rank 2
Answers by
madladuk
Top achievements
Rank 2
Share this question
or