<?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 : Customizing SaveChanges()</title>
  <link>http://www.ideablade.com/forum/</link>
  <description>This is an XML content feed of; DevForce Community Forum : Community Forum : Customizing SaveChanges()</description>
  <pubDate>Fri, 10 Apr 2026 20:03:16 -700</pubDate>
  <lastBuildDate>Tue, 25 Sep 2012 11:51:00 -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=3661</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>Customizing SaveChanges() : This is actually supported in...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=3661&amp;PID=14588#14588</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=1524" rel="nofollow">jtraband</a><br /><strong>Subject:</strong> 3661<br /><strong>Posted:</strong> 25-Sep-2012 at 11:51am<br /><br />This is actually supported in 0.57 ( and higher) versions.&nbsp; We are in the process of documenting it now and will probably complete the documentation before the end of the week.<br><br>&nbsp;But for now, the basic idea is to subclass the EFContextProvider and override either or both of the following methods<br>1) BeforeSaveEntity <br>2) BeforeSaveEntities<br><br>A simple scaffolding is shown below.&nbsp; <br><br>&nbsp;public class NorthwindContextProvider: EFContextProvider&lt;NorthwindIBContext_CF&gt;&nbsp; {&nbsp;&nbsp; <br><br>&nbsp;&nbsp;&nbsp; public override bool BeforeSaveEntity(EntityInfo entityInfo) {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return true;<br>&nbsp;&nbsp;&nbsp; }<br><br>&nbsp;&nbsp;&nbsp; public override Dictionary&lt;Type, List&lt;EntityInfo&gt;&gt; BeforeSaveEntities(Dictionary&lt;Type, List&lt;EntityInfo&gt;&gt; saveMap) {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return saveMap;<br>&nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br>&nbsp; }<br><br>&nbsp; public class NorthwindIBModelController : ApiController {<br><br>&nbsp;&nbsp;&nbsp; NorthwindContextProvider ContextProvider = new NorthwindContextProvider();<br><br>]]>
   </description>
   <pubDate>Tue, 25 Sep 2012 11:51:00 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=3661&amp;PID=14588#14588</guid>
  </item> 
  <item>
   <title>Customizing SaveChanges() : I would like to force some restrictions...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=3661&amp;PID=14582#14582</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=1525" rel="nofollow">pawel</a><br /><strong>Subject:</strong> 3661<br /><strong>Posted:</strong> 25-Sep-2012 at 8:28am<br /><br />I would like to force some restrictions during data modifications.&nbsp;<div>Instead of simple <i>return _contextProvider.SaveChanges(saveBundle); </i>I need more control during/before save.</div><div>How can I execute custom logic during save?</div><div><br></div><div>/Pawel</div>]]>
   </description>
   <pubDate>Tue, 25 Sep 2012 08:28:26 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=3661&amp;PID=14582#14582</guid>
  </item> 
 </channel>
</rss>