<?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 : getting error when calling save on clean(?) entity</title>
  <link>http://www.ideablade.com/forum/</link>
  <description>This is an XML content feed of; DevForce Community Forum : DevForce 2009 : getting error when calling save on clean(?) entity</description>
  <pubDate>Tue, 28 Apr 2026 18:01:13 -700</pubDate>
  <lastBuildDate>Wed, 12 Aug 2009 09:34:55 -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=1419</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>getting error when calling save on clean(?) entity : Hi Daniel, sorry to respond so...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=1419&amp;PID=5154#5154</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=11" rel="nofollow">kimj</a><br /><strong>Subject:</strong> 1419<br /><strong>Posted:</strong> 12-Aug-2009 at 9:34am<br /><br />Hi Daniel, sorry to respond so late.&nbsp;&nbsp; If you check e.IsCompleted or e.Result.SaveOperation first it will indicate the completion state and allow you to work around the problem with accessing e.Entities (which I think is a bug and will log).&nbsp; You're right that the problem occurs when nothing was saved.]]>
   </description>
   <pubDate>Wed, 12 Aug 2009 09:34:55 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=1419&amp;PID=5154#5154</guid>
  </item> 
  <item>
   <title>getting error when calling save on clean(?) entity : I have come up with a workaround...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=1419&amp;PID=5153#5153</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=549" rel="nofollow">DanW</a><br /><strong>Subject:</strong> 1419<br /><strong>Posted:</strong> 12-Aug-2009 at 5:50am<br /><br />I have come up with a workaround of updating the "last updated" audit field that we have on all of our&nbsp;entities so that a save is forced, (which then causes an audit record to be generated in our audit log), so it's not a pretty solution, but I needed to get this process working.&nbsp;&nbsp;&nbsp; <DIV>&nbsp;</DIV><DIV>Thanks, </DIV><DIV>-Daniel</DIV><span style="font-size:10px"><br /><br />Edited by DanW - 12-Aug-2009 at 5:50am</span>]]>
   </description>
   <pubDate>Wed, 12 Aug 2009 05:50:00 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=1419&amp;PID=5153#5153</guid>
  </item> 
  <item>
   <title>getting error when calling save on clean(?) entity : Hello, I have a routine that has...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=1419&amp;PID=5137#5137</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=549" rel="nofollow">DanW</a><br /><strong>Subject:</strong> 1419<br /><strong>Posted:</strong> 10-Aug-2009 at 9:26am<br /><br /><P>Hello,&nbsp; I have a routine that has a contact list, and can send an email from that list.&nbsp; The list is a Sliverlight page, so I was using the AsyncSerialTask to handle the save &amp; send calls, but I ran into an error when I am testing it from the actual silverlight page.. Here is the Async task,&nbsp;&nbsp;</P><P>public void SendContact(DealConfContacts dealConfContacts, AsyncCompletedCallback&lt;InvokeServerMethodEventArgs&gt; callback)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; IList&lt;DealConfContacts&gt; confContacts = new List&lt;DealConfContacts&gt;();<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; confContacts.Add(dealConfContacts);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; SaveOptions saveOpt = new SaveOptions();<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; var task1 = AsyncSerialTask.Create();<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; task1.AddExceptionHandler(TestAsyncSerialTaskSerialExceptionHandler);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; var task2 = task1.AddAsyncSave(Manager, confContacts, saveOpt);</P><DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // This was original save, switched to AddAsyncSave, both error in same place</DIV><DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //var task2 = task1.AddAsyncAction&lt;EntitySavedEventArgs&gt;((serialArgs, callBackTo) =&gt; Manager.SaveChangesAsync(confContacts,callBackTo,null));<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; var task3 = task2.AddAsyncAction&lt;InvokeServerMethodEventArgs&gt;((serialArgs, callBackTo) =&gt; DealConfContactsAsyncBehaviors.SendConfirmAsync("SYSTEM", Manager, dealConfContacts.DealConfirmation, dealConfContacts, "email", callBackTo));<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; task3.Execute(callback);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</DIV><P>The error shows up here when the e.entities is accessed.&nbsp; For the record, the entity may or may not have been dirty at this point, could that be the reason for the error? that the entity was clean when save was called? (I was hoping to write one stack that could save/create the entity, but if I need to differentiate before this point if it is not saved, please let me know.) </P><P>&nbsp;&nbsp;&nbsp;&nbsp; void DomainModelEntityManager_Saved(object sender, EntitySavedEventArgs e)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (!e.Cancelled)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (e.Entities != null)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; foreach (object item in e.Entities)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; var savedItem = item as ISaved;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (savedItem != null)<BR>&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; savedItem.SavedHandler();<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</P><P>Here is the error that I am seeing: </P><P>System.ArgumentNullException was unhandled by user code<BR>&nbsp; Message="Value cannot be null.\r\nParameter name: source"<BR>&nbsp; StackTrace:<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at System.Linq.Enumerable.Select&#091;TSource,TResult&#093;(IEnumerable`1 source, Func`2 selector)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at IdeaBlade.EntityModel.EntitySavedEventArgs.get_Entities()<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at GcsAg.DomainModel.DomainModelEntityManager.DomainModelEntityManager_Saved(Object sender, EntitySavedEventArgs e)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at System.EventHandler`1.Invoke(Object sender, TEventArgs e)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at IdeaBlade.EntityModel.EntityManager.OnSaved(EntitySavedEventArgs args)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at IdeaBlade.EntityModel.EntityManager.&lt;SaveChangesAsyncCore&gt;b__3c(EntitySavedEventArgs args)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at IdeaBlade.EntityModel.AsyncProcessor`1.&lt;Execute&gt;b__1(Object x)<BR>&nbsp; InnerException: <BR></P><DIV>thanks, </DIV><DIV>-DanW</DIV><DIV>&nbsp;</DIV><span style="font-size:10px"><br /><br />Edited by DanW - 10-Aug-2009 at 11:57am</span>]]>
   </description>
   <pubDate>Mon, 10 Aug 2009 09:26:46 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=1419&amp;PID=5137#5137</guid>
  </item> 
 </channel>
</rss>