<?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 : Data Reflection</title>
  <link>http://www.ideablade.com/forum/</link>
  <description>This is an XML content feed of; DevForce Community Forum : DevForce 2010 : Data Reflection</description>
  <pubDate>Fri, 10 Apr 2026 22:31:17 -700</pubDate>
  <lastBuildDate>Tue, 28 Jan 2014 18:12:16 -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=4641</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>Data Reflection : That&amp;#039;s correct. You can use...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=4641&amp;PID=17343#17343</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=912" rel="nofollow">DenisK</a><br /><strong>Subject:</strong> 4641<br /><strong>Posted:</strong> 28-Jan-2014 at 6:12pm<br /><br />That's correct. You can use the following logic to copy values from oldJob to newJob<div><br></div><div>foreach(....)</div><div>{</div><div><span ="Apple-tab-span" style="white-space:pre">	</span>var valueToCopy = dataProperty.GetValue(oldJob);</div><div><span ="Apple-tab-span" style="white-space:pre">	</span>dataProperty.SetValue(newJob, valueToCopy);</div><div>}</div>]]>
   </description>
   <pubDate>Tue, 28 Jan 2014 18:12:16 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=4641&amp;PID=17343#17343</guid>
  </item> 
  <item>
   <title>Data Reflection : so this is what i have so far...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=4641&amp;PID=17341#17341</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=202" rel="nofollow">BillG</a><br /><strong>Subject:</strong> 4641<br /><strong>Posted:</strong> 27-Jan-2014 at 5:12pm<br /><br />so this is what i have so far then<br><br><pre style="font-family:C&#111;nsolas;font-size:13;color:black;:white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:blue;">var</span>&nbsp;query&nbsp;=&nbsp;_manager.JobHistories&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;.Where(j&nbsp;=&gt;&nbsp;j.RefNo&nbsp;==&nbsp;refNo); &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color:blue;">var</span>&nbsp;oldJob&nbsp;=&nbsp;query.Execute().FirstOrDefault(); &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color:blue;">var</span>&nbsp;newJob&nbsp;=&nbsp;_manager.CreateEntity&lt;<span style="color:#2b91af;">JobHistory</span>&gt;(); &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color:blue;">var</span>&nbsp;entityMetadata&nbsp;=&nbsp;_manager.MetadataStore.GetEntityMetadata(<span style="color:blue;">typeof</span>(<span style="color:#2b91af;">JobHistory</span>)); &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:blue;">foreach</span>&nbsp;(<span style="color:blue;">var</span>&nbsp;dataProperty&nbsp;<span style="color:blue;">in</span>&nbsp;entityMetadata.DataProperties)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</pre><br>so now i need to copy the property values from oldJob to newJob<br><br>]]>
   </description>
   <pubDate>Mon, 27 Jan 2014 17:12:28 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=4641&amp;PID=17341#17341</guid>
  </item> 
  <item>
   <title>Data Reflection : Hi Bill,One way to do this is...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=4641&amp;PID=17340#17340</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=912" rel="nofollow">DenisK</a><br /><strong>Subject:</strong> 4641<br /><strong>Posted:</strong> 27-Jan-2014 at 1:54pm<br /><br />Hi Bill,<div><br></div><div>One way to do this is through the use of the entity metadata.&nbsp;</div><div><br></div><div>Below is a code snippet:</div><div><br></div><div>//Grab an entity metadata using its type</div><div>var entityMetadata = entityManager.MetadataStore.GetEntityMetadata(typeof(YourEntity));</div><div><br></div><div>//Loop through the data properties of the entity</div><div>foreach (var dataProperty in entityMetadata.DataProperties) {</div><div><span ="Apple-tab-span" style="white-space:pre">	</span>//Cloning logic here</div><div>&nbsp; &nbsp; &nbsp; &nbsp; dataProperty.SetValue(...);</div><div>}</div><div><br></div><div>Hope this helps.</div>]]>
   </description>
   <pubDate>Mon, 27 Jan 2014 13:54:30 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=4641&amp;PID=17340#17340</guid>
  </item> 
  <item>
   <title>Data Reflection : I have a situation where i have...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=4641&amp;PID=17338#17338</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=202" rel="nofollow">BillG</a><br /><strong>Subject:</strong> 4641<br /><strong>Posted:</strong> 24-Jan-2014 at 3:36pm<br /><br />I have a situation where i have an called job which is an instance of the class JobHistory. I need to pass a job object to a method called BuildNewJobFromExistingJob(). In the method, I need to create a new job object. Then i need to copy all the data from the old object to the new object. Finally i need to change a few of the fields in the object.<br><br>I am thinking of the following as a solution. <br><br>var job = Repository.CreateJobHistory()<br><br>then i want to loop through all the fields of the old object to the new object. I don't want to hard code the copying of the data as fields may be added in the future.<br><br>How do i loop through all the fields in and object copying the data from one to a new object of the same type?<br><br>Bill<br><br><br>]]>
   </description>
   <pubDate>Fri, 24 Jan 2014 15:36:26 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=4641&amp;PID=17338#17338</guid>
  </item> 
 </channel>
</rss>