<?xml version="1.0" encoding="utf-8" ?>
<?xml-stylesheet type="text/xsl" href="RSS_xslt_style.asp" version="1.0" ?>
<rss version="2.0" xmlns:WebWizForums="http://syndication.webwiz.co.uk/rss_namespace/">
 <channel>
  <title>DevForce Community Forum : How do I get a &quot;real&quot; HasChanges?</title>
  <link>http://www.ideablade.com/forum/</link>
  <description>This is an XML content feed of; DevForce Community Forum : DevForce 2010 : How do I get a &quot;real&quot; HasChanges?</description>
  <pubDate>Wed, 29 Jul 2026 17:41:43 -700</pubDate>
  <lastBuildDate>Mon, 14 Mar 2011 11:08:24 -700</lastBuildDate>
  <docs>http://blogs.law.harvard.edu/tech/rss</docs>
  <generator>Web Wiz Forums 9.69</generator>
  <ttl>360</ttl>
  <WebWizForums:feedURL>www.ideablade.com/forum/RSS_post_feed.asp?TID=2556</WebWizForums:feedURL>
  <image>
   <title>DevForce Community Forum</title>
   <url>http://www.ideablade.com/forum/forum_images/IdeaBlade_logo_tm.png</url>
   <link>http://www.ideablade.com/forum/</link>
  </image>
  <item>
   <title>How do I get a &quot;real&quot; HasChanges? : No problem. By the way, you do...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=2556&amp;PID=10167#10167</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=449" rel="nofollow">smi-mark</a><br /><strong>Subject:</strong> 2556<br /><strong>Posted:</strong> 14-Mar-2011 at 11:08am<br /><br />No problem. By the way, you do not need to call BeginEdit() in DevForce.]]>
   </description>
   <pubDate>Mon, 14 Mar 2011 11:08:24 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=2556&amp;PID=10167#10167</guid>
  </item> 
  <item>
   <title>How do I get a &quot;real&quot; HasChanges? : It works indeed! Thank you very...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=2556&amp;PID=10166#10166</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=1095" rel="nofollow">AuerRo</a><br /><strong>Subject:</strong> 2556<br /><strong>Posted:</strong> 14-Mar-2011 at 11:01am<br /><br />It works indeed! Thank you very much!]]>
   </description>
   <pubDate>Mon, 14 Mar 2011 11:01:47 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=2556&amp;PID=10166#10166</guid>
  </item> 
  <item>
   <title>How do I get a &quot;real&quot; HasChanges? : I&amp;#039;ve created some extension...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=2556&amp;PID=10165#10165</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=449" rel="nofollow">smi-mark</a><br /><strong>Subject:</strong> 2556<br /><strong>Posted:</strong> 14-Mar-2011 at 8:42am<br /><br />I've created some extension methods to do this.<br><br>It hasn't been fully tested yet but it seems to work on everything I've done so far.<br><br><br>public static bool IsDirty(this EntityWrapper wrapper)<br>{<br>&nbsp;&nbsp;&nbsp; if (wrapper.EntityAspect.EntityState == EntityState.Unchanged)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return false;<br><br>&nbsp;&nbsp;&nbsp; if (wrapper.EntityAspect.EntityState == EntityState.Added)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return true;<br><br>&nbsp;&nbsp;&nbsp; return wrapper.EntityAspect.EntityMetadata.DataProperties<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; .Where(p =&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; p.GetValue(wrapper, EntityVersion.Original) != p.GetValue(wrapper, EntityVersion.Current)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &amp;&amp;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; !p.GetValue(wrapper, EntityVersion.Original).Equals(p.GetValue(wrapper, EntityVersion.Current)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; )).Any();<br>}<br><br>public static bool IsDirty(this EntityManager manager)<br>{<br>&nbsp;&nbsp; return manager.GetEntityGroups().Any(g =&gt; g.Any(w =&gt; w.IsDirty()));<br>}<br>]]>
   </description>
   <pubDate>Mon, 14 Mar 2011 08:42:17 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=2556&amp;PID=10165#10165</guid>
  </item> 
  <item>
   <title>How do I get a &quot;real&quot; HasChanges? : Hi, quick intro: &amp;#034;real&amp;#034;...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=2556&amp;PID=10164#10164</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=1095" rel="nofollow">AuerRo</a><br /><strong>Subject:</strong> 2556<br /><strong>Posted:</strong> 14-Mar-2011 at 2:44am<br /><br /><div><div><div><div><font ="Apple-style-span" color="#444444" face="verdana, Helvetica, sans-serif"><div><span ="Apple-style-span" style="font-size: 11px; line-height: 13px;">Hi, <b>quick intro</b>: "real" HasChanges means HasChanges to return False, if changes are undone manually in the UI by the user.</span></div><div><span ="Apple-style-span" style="font-size: 11px; line-height: 13px;"><br></span></div><div><span ="Apple-style-span" style="font-size: 11px; line-height: 13px;">I'm quite new to DevForce, and had the similar question in RIA Services before. As I switched to DevForce (several reasons), ran into the same problem, and thought maybe there is a solution for this already implemented.</span></div><div><span ="Apple-style-span" style="font-size: 11px; line-height: 13px;"><br></span></div><div><span ="Apple-style-span" style="font-size: 11px; line-height: 13px;"><b>Description</b>:</span></div><div><ul><li><span ="Apple-style-span" style="font-size: 11px; line-height: 13px; ">I have an entity (e.g. Employee), on which I activate IEditableObject.BeginEdit() and change a Property (e.g. Property "Surname" from "Auer" to "Auerrr").</span></li><li><span ="Apple-style-span" style="font-size: 11px; line-height: 13px; ">If I call employee.EntityAspect.HasChanges, it returns True, perfect.</span></li><li><span ="Apple-style-span" style="font-size: 11px; line-height: 13px; ">Now I change the Property back to the original value ("Surname" from "Auerrr" to "Auer").</span></li><li><span ="Apple-style-span" style="font-size: 11px; line-height: 13px; ">I want HasChanges to be False, but it isn't.</span></li></ul></div><div><span ="Apple-style-span" style="font-size: 11px; line-height: 13px;"><br></span></div><div><span ="Apple-style-span" style="font-size: 11px; line-height: 13px;"><b>Questions:&nbsp;</b></span></div><div><ul><li><span ="Apple-style-span" style="font-size: 11px; line-height: 13px; ">Do I have to compare all entity-properties in my own code, or is there an easy way to achieve a "real" HasChanges?&nbsp;</span></li><li><span ="Apple-style-span" style="font-size: 11px; line-height: 13px; ">If I have to compare them on my own, what would be the best way to achieve this? (I think the easiest way would be to compare the properties with the clone-source created in the implementation of IEditableObject, but: Is there a way to access it?)</span></li><li><span ="Apple-style-span" style="font-size: 11px; line-height: 13px; ">What is the difference between EntityAspect.IsChanged and EntityAspect.HasChanges()?</span></li></ul></div><div><span ="Apple-style-span" style="font-size: 11px; line-height: 13px;">Thanks for any hint!</span></div></font></div></div></div></div>]]>
   </description>
   <pubDate>Mon, 14 Mar 2011 02:44:33 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=2556&amp;PID=10164#10164</guid>
  </item> 
 </channel>
</rss>