Tracking entity modifications in silverlight 4

2 posts, 0 answers
  1. madladuk
    madladuk avatar
    126 posts
    Member since:
    Dec 2009

    Posted 06 Oct 2010 Link to this post

    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>}

  2. madladuk
    madladuk avatar
    126 posts
    Member since:
    Dec 2009

    Posted 06 Oct 2010 Link to this post

    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

  3. DevCraft banner
Back to Top