<?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 : Differing MergeStrategies among the canned QueryStrategies</title>
  <link>http://www.ideablade.com/forum/</link>
  <description>This is an XML content feed of; DevForce Community Forum : DevForce 2009 : Differing MergeStrategies among the canned QueryStrategies</description>
  <pubDate>Sat, 11 Apr 2026 09:55:42 -700</pubDate>
  <lastBuildDate>Wed, 12 Aug 2009 12:21:51 -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=1422</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>Differing MergeStrategies among the canned QueryStrategies : My colleague David and I did some...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=1422&amp;PID=5156#5156</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=482" rel="nofollow">WardBell</a><br /><strong>Subject:</strong> 1422<br /><strong>Posted:</strong> 12-Aug-2009 at 12:21pm<br /><br /><P style="LINE-HEIGHT: normal; MARGIN: 0in 1.5pt 0pt" ="Ms&#111;normal"><SPAN style="COLOR: #1f497d; FONT-SIZE: 12pt; mso-themecolor: dark2; mso-fareast-font-family: 'Times New Roman'; mso-ascii-font-family: Calibri; mso-hansi-font-family: Calibri; mso-bidi-font-family: Calibri; mso-ansi-: EN" lang=EN><FONT face=Calibri>My colleague David and I did some exploring of what I call the <B style="mso-bidi-font-weight: normal">“Davolio/Smith” Scenario</B> to see what happens when you change the QueryStrategy. The scenario is as follows:<?: prefix = o ns = "urn:schemas-microsoft-com:office:office" /><O:P></O:P></FONT></SPAN></P><P style="LINE-HEIGHT: normal; MARGIN: 0in 1.5pt 0pt" ="Ms&#111;normal"><SPAN style="FONT-FAMILY: 'Verdana','sans-serif'; COLOR: black; FONT-SIZE: 9pt; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman'; mso-ansi-: EN" lang=EN>&nbsp;</SPAN><SPAN style="COLOR: #1f497d; FONT-SIZE: 9pt; mso-themecolor: dark2; mso-fareast-font-family: 'Times New Roman'; mso-ansi-: EN" lang=EN><O:P></O:P></SPAN></P><P style="LINE-HEIGHT: normal; MARGIN: 0in 1.5pt 0pt" ="Ms&#111;normal"><SPAN style="COLOR: #1f497d; FONT-SIZE: 12pt; mso-themecolor: dark2; mso-fareast-font-family: 'Times New Roman'; mso-ascii-font-family: Calibri; mso-hansi-font-family: Calibri; mso-bidi-font-family: Calibri; mso-ansi-: EN" lang=EN><FONT face=Calibri>Suppose you had fetched all Employees from Northwind. You changed&nbsp;Employee with Id=1 (my good friend, "Nancy Davolio") from "Davolio" to "Smith" ... but you don't save. Now query for employees named "Davolio" using the "Normal", "DatasourceOnly" and "DatasourceThenCache" query strategies. Execute the query with FirstOrNullEntity which returns the first entity found or the null Employee.<O:P></O:P></FONT></SPAN></P><P style="LINE-HEIGHT: normal; MARGIN: 0in 1.5pt 0pt" ="Ms&#111;normal"><SPAN style="COLOR: #1f497d; FONT-SIZE: 12pt; mso-themecolor: dark2; mso-fareast-font-family: 'Times New Roman'; mso-ascii-font-family: Calibri; mso-hansi-font-family: Calibri; mso-bidi-font-family: Calibri; mso-ansi-: EN" lang=EN><O:P><FONT face=Calibri>&nbsp;</FONT></O:P></SPAN></P><P style="LINE-HEIGHT: normal; MARGIN: 0in 1.5pt 0pt" ="Ms&#111;normal"><SPAN style="COLOR: #1f497d; FONT-SIZE: 12pt; mso-themecolor: dark2; mso-fareast-font-family: 'Times New Roman'; mso-ascii-font-family: Calibri; mso-hansi-font-family: Calibri; mso-bidi-font-family: Calibri; mso-ansi-: EN" lang=EN><FONT face=Calibri><SPAN style="mso-spacerun: yes">&nbsp;</SPAN>I had predicted that<O:P></O:P></FONT></SPAN></P><P style="TEXT-INDENT: -0.25in; MARGIN: 5pt 1.5pt 0pt 37.5pt; mso-list: l0 level1 lfo1" ="MsoListParagraph"><SPAN style="FONT-FAMILY: Symbol; COLOR: #1f497d; mso-themecolor: dark2; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol; mso-ansi-: EN" lang=EN><SPAN style="mso-list: Ignore"><FONT size=3>·</FONT><SPAN style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></SPAN></SPAN><SPAN style="FONT-FAMILY: 'Calibri','sans-serif'; COLOR: #1f497d; mso-themecolor: dark2; mso-ansi-: EN" lang=EN><FONT size=3>With “Normal” , returns NullEntity<O:P></O:P></FONT></SPAN></P><P style="TEXT-INDENT: -0.25in; MARGIN: 5pt 1.5pt 0pt 37.5pt; mso-list: l0 level1 lfo1" ="MsoListParagraph"><SPAN style="FONT-FAMILY: Symbol; COLOR: #1f497d; mso-themecolor: dark2; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol; mso-ansi-: EN" lang=EN><SPAN style="mso-list: Ignore"><FONT size=3>·</FONT><SPAN style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></SPAN></SPAN><SPAN style="FONT-FAMILY: 'Calibri','sans-serif'; COLOR: #1f497d; mso-themecolor: dark2; mso-ansi-: EN" lang=EN><FONT size=3>With “Datasource”, returns ... I wasn’t sure but I hoped for NullEntity<O:P></O:P></FONT></SPAN></P><P style="TEXT-INDENT: -0.25in; MARGIN: 5pt 1.5pt 0pt 37.5pt; mso-list: l0 level1 lfo1" ="MsoListParagraph"><SPAN style="FONT-FAMILY: Symbol; COLOR: #1f497d; mso-themecolor: dark2; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol; mso-ansi-: EN" lang=EN><SPAN style="mso-list: Ignore"><FONT size=3>·</FONT><SPAN style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></SPAN></SPAN><SPAN style="FONT-FAMILY: 'Calibri','sans-serif'; COLOR: #1f497d; mso-themecolor: dark2; mso-ansi-: EN" lang=EN><FONT size=3>With “DatasourceThenCache”, returns NullEntity<O:P></O:P></FONT></SPAN></P><SPAN style="COLOR: #1f497d; FONT-SIZE: 12pt; mso-themecolor: dark2; mso-fareast-font-family: 'Times New Roman'; mso-ascii-font-family: Calibri; mso-hansi-font-family: Calibri; mso-bidi-font-family: Calibri; mso-ansi-: EN" lang=EN><FONT face=Calibri><DIV>&nbsp;</DIV><DIV>Why? Although her name is still “Davolio” in the database, she is “Smith” locally and the query should return the local interpretation no matter what the strategy.&nbsp; There is&nbsp;no employee with the last name "Davolio" in my local cache. Therefore I should get nothing ... and since we executed with FirstOrNullEntity, I should get the null Employee entity.<O:P></O:P></FONT></SPAN></DIV><P style="LINE-HEIGHT: normal; MARGIN: 0in 1.5pt 0pt" ="Ms&#111;normal"><SPAN style="COLOR: #1f497d; FONT-SIZE: 12pt; mso-themecolor: dark2; mso-fareast-font-family: 'Times New Roman'; mso-ascii-font-family: Calibri; mso-hansi-font-family: Calibri; mso-bidi-font-family: Calibri; mso-ansi-: EN" lang=EN><O:P><FONT face=Calibri>&nbsp;</FONT></O:P></SPAN></P><P style="LINE-HEIGHT: normal; MARGIN: 0in 1.5pt 0pt" ="Ms&#111;normal"><FONT face=Calibri><SPAN style="COLOR: #1f497d; FONT-SIZE: 12pt; mso-themecolor: dark2; mso-fareast-font-family: 'Times New Roman'; mso-ascii-font-family: Calibri; mso-hansi-font-family: Calibri; mso-bidi-font-family: Calibri; mso-ansi-: EN" lang=EN>I was surprised to be wrong about the actual results which were.</SPAN><SPAN style="COLOR: #1f497d; FONT-SIZE: 9pt; mso-themecolor: dark2; mso-fareast-font-family: 'Times New Roman'; mso-ansi-: EN" lang=EN><O:P></O:P></SPAN></FONT></P><P style="TEXT-INDENT: -0.25in; MARGIN: 5pt 1.5pt 0pt 37.5pt; mso-list: l0 level1 lfo1" ="MsoListParagraph"><SPAN style="FONT-FAMILY: Symbol; COLOR: #1f497d; mso-themecolor: dark2; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol; mso-ansi-: EN" lang=EN><SPAN style="mso-list: Ignore"><FONT size=3>·</FONT><SPAN style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></SPAN></SPAN><SPAN style="FONT-FAMILY: 'Calibri','sans-serif'; COLOR: #1f497d; mso-themecolor: dark2; mso-ansi-: EN" lang=EN><FONT size=3>With “Normal” , returns NullEntity (check)<O:P></O:P></FONT></SPAN></P><P style="TEXT-INDENT: -0.25in; MARGIN: 5pt 1.5pt 0pt 37.5pt; mso-list: l0 level1 lfo1" ="MsoListParagraph"><SPAN style="FONT-FAMILY: Symbol; COLOR: #1f497d; mso-themecolor: dark2; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol; mso-ansi-: EN" lang=EN><SPAN style="mso-list: Ignore"><FONT size=3>·</FONT><SPAN style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></SPAN></SPAN><SPAN style="FONT-FAMILY: 'Calibri','sans-serif'; COLOR: #1f497d; mso-themecolor: dark2; mso-ansi-: EN" lang=EN><FONT size=3>With “Datasource”, employee with id=1, name = “Davolio” (Not null entity? not Smith!)<O:P></O:P></FONT></SPAN></P><P style="TEXT-INDENT: -0.25in; MARGIN: 5pt 1.5pt 0pt 37.5pt; mso-list: l0 level1 lfo1" ="MsoListParagraph"><SPAN style="FONT-FAMILY: Symbol; COLOR: #1f497d; mso-themecolor: dark2; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol; mso-ansi-: EN" lang=EN><SPAN style="mso-list: Ignore"><FONT size=3>·</FONT><SPAN style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></SPAN></SPAN><SPAN style="FONT-FAMILY: 'Calibri','sans-serif'; COLOR: #1f497d; mso-themecolor: dark2; mso-ansi-: EN" lang=EN><FONT size=3>With “DatasourceThenCache”, same as “Datasource” (grrr)<O:P></O:P></FONT></SPAN></P><SPAN style="COLOR: #1f497d; FONT-SIZE: 12pt; mso-themecolor: dark2; mso-fareast-font-family: 'Times New Roman'; mso-ascii-font-family: Calibri; mso-hansi-font-family: Calibri; mso-bidi-font-family: Calibri; mso-ansi-: EN" lang=EN><FONT face=Calibri><DIV>&nbsp;</DIV><DIV>How could I get the "Davolio" employee? Why is she not "Smith"? I know she can't be both "Smith" and "Davolio" and I know I'm not getting different instances of the Employee with Id == 1.</DIV><DIV>&nbsp;</DIV><DIV>An assumption in my head turned out to be wrong. I thought that the pre-canned QueryStrategies <SPAN style="mso-spacerun: yes">&nbsp;</SPAN>-- Normal, DatasourceOnly, and DatasourceThenCache -- all used the same MergeStrategy: “PreserveChanges”.<O:P></O:P></FONT></SPAN></DIV><P style="LINE-HEIGHT: normal; MARGIN: 0in 1.5pt 0pt" ="Ms&#111;normal"><SPAN style="COLOR: #1f497d; FONT-SIZE: 12pt; mso-themecolor: dark2; mso-fareast-font-family: 'Times New Roman'; mso-ansi-: EN" lang=EN><O:P><FONT face=Calibri>&nbsp;</FONT></O:P></SPAN></P><P style="LINE-HEIGHT: normal; MARGIN: 0in 1.5pt 0pt" ="Ms&#111;normal"><SPAN style="COLOR: #1f497d; FONT-SIZE: 12pt; mso-themecolor: dark2; mso-fareast-font-family: 'Times New Roman'; mso-ascii-font-family: Calibri; mso-hansi-font-family: Calibri; mso-bidi-font-family: Calibri; mso-ansi-: EN" lang=EN><FONT face=Calibri>That is not so.The DataSource strategies use "OverwriteChanges" which means that my change from "Davolio" to "Smith" was overwritten with the value from the database.</P><DIV>&nbsp;</DIV><DIV>While I think that the MergeStrategy should have remained unchanged - should have been PreserveChanges - (as I argued in the thread below), I do not win every argument around here </FONT></SPAN><SPAN style="FONT-FAMILY: Wingdings; COLOR: #1f497d; FONT-SIZE: 12pt; mso-themecolor: dark2; mso-fareast-font-family: 'Times New Roman'; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin; mso-symbol-font-family: Wingdings; mso-ansi-: EN; mso-char-: symbol" lang=EN><SPAN style="mso-symbol-font-family: Wingdings; mso-char-: symbol">J</SPAN></SPAN><SPAN style="COLOR: #1f497d; FONT-SIZE: 12pt; mso-themecolor: dark2; mso-fareast-font-family: 'Times New Roman'; mso-ascii-font-family: Calibri; mso-hansi-font-family: Calibri; mso-bidi-font-family: Calibri; mso-ansi-: EN" lang=EN><FONT face=Calibri>. To be fair, reasonable minds could differ about what is the best default behavior.<O:P></O:P></FONT></SPAN></DIV><P style="LINE-HEIGHT: normal; MARGIN: 0in 1.5pt 0pt" ="Ms&#111;normal"><SPAN style="COLOR: #1f497d; FONT-SIZE: 12pt; mso-themecolor: dark2; mso-fareast-font-family: 'Times New Roman'; mso-ansi-: EN" lang=EN><O:P><FONT face=Calibri>&nbsp;</P><P style="LINE-HEIGHT: normal; MARGIN: 0in 1.5pt 0pt" ="Ms&#111;normal"><SPAN style="COLOR: #1f497d; FONT-SIZE: 12pt; mso-themecolor: dark2; mso-fareast-font-family: 'Times New Roman'; mso-ascii-font-family: Calibri; mso-hansi-font-family: Calibri; mso-bidi-font-family: Calibri; mso-ansi-: EN" lang=EN><FONT face=Calibri>Here is a snippet that gives DatasourceThenCache the MergeStrategy that I expected. <?: PREFIX = O /><O:P></O:P></FONT></SPAN></P><P style="LINE-HEIGHT: normal; MARGIN: 0in 1.5pt 0pt" ="Ms&#111;normal"><SPAN style="COLOR: #1f497d; FONT-SIZE: 12pt; mso-themecolor: dark2; mso-fareast-font-family: 'Times New Roman'; mso-ascii-font-family: Calibri; mso-hansi-font-family: Calibri; mso-bidi-font-family: Calibri; mso-ansi-: EN" lang=EN><FONT face=Calibri>&nbsp;&nbsp; </FONT></SPAN><SPAN style="FONT-FAMILY: 'Courier New'; COLOR: black; FONT-SIZE: 10pt; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-size: 12.0pt; mso-ansi-: EN" lang=EN>QueryStrategy.DataSourceThenCache.With(MergeStrategy.PreserveChanges)</SPAN>&nbsp;</FONT></O:P></SPAN></P><SPAN style="COLOR: #1f497d; FONT-SIZE: 12pt; mso-themecolor: dark2; mso-fareast-font-family: 'Times New Roman'; mso-ascii-font-family: Calibri; mso-hansi-font-family: Calibri; mso-bidi-font-family: Calibri; mso-ansi-: EN" lang=EN><FONT face=Calibri><DIV>&nbsp;</DIV><DIV>Accordingly, please take note: the MergeStrategy is not the same across all of the pre-wired QueryStrategies. <O:P></O:P></FONT></SPAN></DIV><P style="LINE-HEIGHT: normal; MARGIN: 0in 1.5pt 0pt" ="Ms&#111;normal"><SPAN style="COLOR: #1f497d; FONT-SIZE: 12pt; mso-themecolor: dark2; mso-fareast-font-family: 'Times New Roman'; mso-ansi-: EN" lang=EN><O:P></SPAN></P><P style="LINE-HEIGHT: normal; MARGIN: 0in 1.5pt 0pt" ="Ms&#111;normal"><SPAN style="COLOR: #1f497d; FONT-SIZE: 12pt; mso-themecolor: dark2; mso-fareast-font-family: 'Times New Roman'; mso-ansi-: EN" lang=EN><O:P></O:P></SPAN></P><P style="LINE-HEIGHT: normal; MARGIN: 0in 1.5pt 0pt" ="Ms&#111;normal"><SPAN style="FONT-FAMILY: 'Times New Roman','serif'; COLOR: #1f497d; FONT-SIZE: 12pt; mso-fareast-font-family: 'Times New Roman'; mso-ansi-: EN" lang=EN><O:P>&nbsp;</O:P></SPAN></P><P style="LINE-HEIGHT: normal; MARGIN: 0in 1.5pt 0pt" ="Ms&#111;normal"><SPAN style="COLOR: #1f497d; FONT-SIZE: 12pt; mso-themecolor: dark2; mso-fareast-font-family: 'Times New Roman'; mso-ascii-font-family: Calibri; mso-hansi-font-family: Calibri; mso-bidi-font-family: Calibri; mso-ansi-: EN" lang=EN><FONT face=Calibri>Lesson #1: Check out all aspects of the QueryStrategy before you use it. The QueryStrategy today consists of three parts<O:P></O:P></FONT></SPAN></P><P style="TEXT-INDENT: -0.25in; MARGIN: 5pt 1.5pt 0pt 37.5pt; mso-list: l1 level1 lfo2" ="MsoListParagraph"><SPAN style="FONT-FAMILY: Symbol; COLOR: #1f497d; mso-themecolor: dark2; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol; mso-ansi-: EN" lang=EN><SPAN style="mso-list: Ignore"><FONT size=3>·</FONT><SPAN style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></SPAN></SPAN><SPAN style="FONT-FAMILY: 'Calibri','sans-serif'; COLOR: #1f497d; mso-themecolor: dark2; mso-ansi-: EN" lang=EN><FONT size=3>FetchStrategy (how and when the EntityManager goes to data source and the cache)<O:P></O:P></FONT></SPAN></P><P style="TEXT-INDENT: -0.25in; MARGIN: 5pt 1.5pt 0pt 37.5pt; mso-list: l1 level1 lfo2" ="MsoListParagraph"><SPAN style="FONT-FAMILY: Symbol; COLOR: #1f497d; mso-themecolor: dark2; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol; mso-ansi-: EN" lang=EN><SPAN style="mso-list: Ignore"><FONT size=3>·</FONT><SPAN style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></SPAN></SPAN><SPAN style="FONT-FAMILY: 'Calibri','sans-serif'; COLOR: #1f497d; mso-themecolor: dark2; mso-ansi-: EN" lang=EN><FONT size=3>MergeStrategy (what to do when a retrieved entity is found in the cache)<O:P></O:P></FONT></SPAN></P><P style="TEXT-INDENT: -0.25in; MARGIN: 5pt 1.5pt 0pt 37.5pt; mso-list: l1 level1 lfo2" ="MsoListParagraph"><SPAN style="FONT-FAMILY: Symbol; COLOR: #1f497d; mso-themecolor: dark2; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol; mso-ansi-: EN" lang=EN><SPAN style="mso-list: Ignore"><FONT size=3>·</FONT><SPAN style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></SPAN></SPAN><SPAN style="FONT-FAMILY: 'Calibri','sans-serif'; COLOR: #1f497d; mso-themecolor: dark2; mso-ansi-: EN" lang=EN><FONT size=3>QueryOptions (other dials)<O:P></O:P></FONT></SPAN></P><P style="LINE-HEIGHT: normal; MARGIN: 0in 1.5pt 0pt" ="Ms&#111;normal"><SPAN style="COLOR: #1f497d; FONT-SIZE: 12pt; mso-themecolor: dark2; mso-fareast-font-family: 'Times New Roman'; mso-ascii-font-family: Calibri; mso-hansi-font-family: Calibri; mso-bidi-font-family: Calibri; mso-ansi-: EN" lang=EN><O:P><FONT face=Calibri>&nbsp;</FONT></O:P></SPAN></P><P style="LINE-HEIGHT: normal; MARGIN: 0in 1.5pt 0pt" ="Ms&#111;normal"><SPAN style="COLOR: #1f497d; FONT-SIZE: 12pt; mso-themecolor: dark2; mso-fareast-font-family: 'Times New Roman'; mso-ascii-font-family: Calibri; mso-hansi-font-family: Calibri; mso-bidi-font-family: Calibri; mso-ansi-: EN" lang=EN><FONT face=Calibri>Lesson #2: You may want to create your own QueryStrategies so that they fit your expectations and are used consistently everywhere.<O:P></O:P></FONT></SPAN></P><P style="LINE-HEIGHT: normal; MARGIN: 0in 1.5pt 0pt" ="Ms&#111;normal"><SPAN style="FONT-FAMILY: 'Times New Roman','serif'; COLOR: black; FONT-SIZE: 12pt; mso-fareast-font-family: 'Times New Roman'; mso-ansi-: EN" lang=EN>&nbsp;</SPAN><SPAN style="COLOR: #1f497d; FONT-SIZE: 12pt; mso-themecolor: dark2; mso-fareast-font-family: 'Times New Roman'; mso-ansi-: EN" lang=EN><O:P></O:P></SPAN></P><P style="LINE-HEIGHT: normal; MARGIN: 0in 1.5pt 0pt" ="Ms&#111;normal"><FONT face=Calibri><SPAN style="COLOR: #1f497d; FONT-SIZE: 12pt; mso-themecolor: dark2; mso-fareast-font-family: 'Times New Roman'; mso-ascii-font-family: Calibri; mso-hansi-font-family: Calibri; mso-bidi-font-family: Calibri; mso-ansi-: EN" lang=EN>The following is the&nbsp;email thread of my journey to enlightenment. Hope you will find the tale cautionary and instructive.</SPAN><SPAN style="COLOR: #1f497d; FONT-SIZE: 12pt; mso-themecolor: dark2; mso-fareast-font-family: 'Times New Roman'; mso-ansi-: EN" lang=EN><O:P></O:P></SPAN></FONT></P><P style="LINE-HEIGHT: normal; MARGIN: 0in 1.5pt 0pt" ="Ms&#111;normal"><FONT face=Calibri><SPAN style="COLOR: #1f497d; FONT-SIZE: 12pt; mso-themecolor: dark2; mso-fareast-font-family: 'Times New Roman'; mso-ascii-font-family: Calibri; mso-hansi-font-family: Calibri; mso-bidi-font-family: Calibri; mso-ansi-: EN" lang=EN>&nbsp;------</SPAN><SPAN style="COLOR: #1f497d; FONT-SIZE: 12pt; mso-themecolor: dark2; mso-fareast-font-family: 'Times New Roman'; mso-ansi-: EN" lang=EN><O:P></O:P></SPAN></FONT></P><P style="LINE-HEIGHT: normal; MARGIN: 0in 1.5pt 0pt" ="Ms&#111;normal"><B><SPAN style="FONT-FAMILY: 'Tahoma','sans-serif'; COLOR: black; FONT-SIZE: 10pt; mso-fareast-font-family: 'Times New Roman'; mso-ansi-: EN" lang=EN>Sent:</SPAN></B><SPAN style="FONT-FAMILY: 'Tahoma','sans-serif'; COLOR: black; FONT-SIZE: 10pt; mso-fareast-font-family: 'Times New Roman'; mso-ansi-: EN" lang=EN> Tuesday, August 11, 2009 2:26 PM<BR><B>To:</B> Ward Bell<BR><B>Subject:</B> RE: DataSource test</SPAN><SPAN style="FONT-FAMILY: 'Times New Roman','serif'; COLOR: #1f497d; FONT-SIZE: 12pt; mso-fareast-font-family: 'Times New Roman'; mso-ansi-: EN-CA" lang=EN-CA><O:P></O:P></SPAN></P><P style="LINE-HEIGHT: normal; MARGIN: 0in 1.5pt 0pt" ="Ms&#111;normal"><SPAN style="COLOR: #1f497d; FONT-SIZE: 12pt; mso-fareast-font-family: 'Times New Roman'; mso-ascii-font-family: Calibri; mso-hansi-font-family: Calibri; mso-bidi-font-family: Calibri; mso-ansi-: EN-CA" lang=EN-CA><O:P><FONT face=Calibri>&nbsp;</FONT></O:P></SPAN></P><P style="LINE-HEIGHT: normal; MARGIN: 0in 1.5pt 0pt" ="Ms&#111;normal"><SPAN style="COLOR: #1f497d; FONT-SIZE: 12pt; mso-fareast-font-family: 'Times New Roman'; mso-ascii-font-family: Calibri; mso-hansi-font-family: Calibri; mso-bidi-font-family: Calibri; mso-ansi-: EN-CA" lang=EN-CA><FONT face=Calibri>Both of these tests pass...<O:P></O:P></FONT></SPAN></P><P style="LINE-HEIGHT: normal; MARGIN: 0in 1.5pt 0pt" ="Ms&#111;normal"><SPAN style="FONT-FAMILY: 'Times New Roman','serif'; COLOR: #1f497d; FONT-SIZE: 12pt; mso-fareast-font-family: 'Times New Roman'; mso-ansi-: EN-CA" lang=EN-CA><O:P>&nbsp;</O:P></SPAN></P><P style="LINE-HEIGHT: normal; MARGIN: 0in 1.5pt 0pt 0in" ="Ms&#111;normal"><SPAN style="FONT-FAMILY: 'Courier New'; COLOR: black; FONT-SIZE: 10pt; mso-fareast-font-family: 'Times New Roman'; mso-ansi-: EN-CA" lang=EN-CA>&nbsp; &#091;</SPAN><SPAN style="FONT-FAMILY: 'Courier New'; COLOR: #2b91af; FONT-SIZE: 10pt; mso-fareast-font-family: 'Times New Roman'; mso-ansi-: EN-CA" lang=EN-CA>TestMethod</SPAN><SPAN style="FONT-FAMILY: 'Courier New'; COLOR: black; FONT-SIZE: 10pt; mso-fareast-font-family: 'Times New Roman'; mso-ansi-: EN-CA" lang=EN-CA>&#093;<O:P></O:P></SPAN></P><P style="LINE-HEIGHT: normal; MARGIN: 0in 1.5pt 0pt 0in" ="Ms&#111;normal"><SPAN style="FONT-FAMILY: 'Courier New'; COLOR: black; FONT-SIZE: 10pt; mso-fareast-font-family: 'Times New Roman'; mso-ansi-: EN-CA" lang=EN-CA>&nbsp; </SPAN><SPAN style="FONT-FAMILY: 'Courier New'; COLOR: blue; FONT-SIZE: 10pt; mso-fareast-font-family: 'Times New Roman'; mso-ansi-: EN-CA" lang=EN-CA>public</SPAN><SPAN style="FONT-FAMILY: 'Courier New'; COLOR: black; FONT-SIZE: 10pt; mso-fareast-font-family: 'Times New Roman'; mso-ansi-: EN-CA" lang=EN-CA> </SPAN><SPAN style="FONT-FAMILY: 'Courier New'; COLOR: blue; FONT-SIZE: 10pt; mso-fareast-font-family: 'Times New Roman'; mso-ansi-: EN-CA" lang=EN-CA>void</SPAN><SPAN style="FONT-FAMILY: 'Courier New'; COLOR: black; FONT-SIZE: 10pt; mso-fareast-font-family: 'Times New Roman'; mso-ansi-: EN-CA" lang=EN-CA> DataSourceNormalTest()<O:P></O:P></SPAN></P><P style="LINE-HEIGHT: normal; MARGIN: 0in 1.5pt 0pt 0in" ="Ms&#111;normal"><SPAN style="FONT-FAMILY: 'Courier New'; COLOR: black; FONT-SIZE: 10pt; mso-fareast-font-family: 'Times New Roman'; mso-ansi-: EN-CA" lang=EN-CA>&nbsp; {<O:P></O:P></SPAN></P><P style="LINE-HEIGHT: normal; MARGIN: 0in 1.5pt 0pt 0in" ="Ms&#111;normal"><SPAN style="FONT-FAMILY: 'Courier New'; COLOR: black; FONT-SIZE: 10pt; mso-fareast-font-family: 'Times New Roman'; mso-ansi-: EN-CA" lang=EN-CA>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="FONT-FAMILY: 'Courier New'; COLOR: green; FONT-SIZE: 10pt; mso-fareast-font-family: 'Times New Roman'; mso-ansi-: EN-CA" lang=EN-CA>//<O:P></O:P></SPAN></P><P style="LINE-HEIGHT: normal; MARGIN: 0in 1.5pt 0pt 0in" ="Ms&#111;normal"><SPAN style="FONT-FAMILY: 'Courier New'; COLOR: black; FONT-SIZE: 10pt; mso-fareast-font-family: 'Times New Roman'; mso-ansi-: EN-CA" lang=EN-CA>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="FONT-FAMILY: 'Courier New'; COLOR: green; FONT-SIZE: 10pt; mso-fareast-font-family: 'Times New Roman'; mso-ansi-: EN-CA" lang=EN-CA>// TODO: Add test logic here<O:P></O:P></SPAN></P><P style="LINE-HEIGHT: normal; MARGIN: 0in 1.5pt 0pt 0in" ="Ms&#111;normal"><SPAN style="FONT-FAMILY: 'Courier New'; COLOR: black; FONT-SIZE: 10pt; mso-fareast-font-family: 'Times New Roman'; mso-ansi-: EN-CA" lang=EN-CA>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="FONT-FAMILY: 'Courier New'; COLOR: green; FONT-SIZE: 10pt; mso-fareast-font-family: 'Times New Roman'; mso-ansi-: EN-CA" lang=EN-CA>//<O:P></O:P></SPAN></P><P style="LINE-HEIGHT: normal; MARGIN: 0in 1.5pt 0pt 0in" ="Ms&#111;normal"><SPAN style="FONT-FAMILY: 'Courier New'; COLOR: black; FONT-SIZE: 10pt; mso-fareast-font-family: 'Times New Roman'; mso-ansi-: EN-CA" lang=EN-CA>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="FONT-FAMILY: 'Courier New'; COLOR: blue; FONT-SIZE: 10pt; mso-fareast-font-family: 'Times New Roman'; mso-ansi-: EN-CA" lang=EN-CA>var</SPAN><SPAN style="FONT-FAMILY: 'Courier New'; COLOR: black; FONT-SIZE: 10pt; mso-fareast-font-family: 'Times New Roman'; mso-ansi-: EN-CA" lang=EN-CA> _dm = </SPAN><SPAN style="FONT-FAMILY: 'Courier New'; COLOR: #2b91af; FONT-SIZE: 10pt; mso-fareast-font-family: 'Times New Roman'; mso-ansi-: EN-CA" lang=EN-CA>DomainModelEntityManager</SPAN><SPAN style="FONT-FAMILY: 'Courier New'; COLOR: black; FONT-SIZE: 10pt; mso-fareast-font-family: 'Times New Roman'; mso-ansi-: EN-CA" lang=EN-CA>.DefaultManager;<O:P></O:P></SPAN></P><P style="LINE-HEIGHT: normal; MARGIN: 0in 1.5pt 0pt 0in" ="Ms&#111;normal"><SPAN style="FONT-FAMILY: 'Courier New'; COLOR: black; FONT-SIZE: 10pt; mso-fareast-font-family: 'Times New Roman'; mso-ansi-: EN-CA" lang=EN-CA>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="FONT-FAMILY: 'Courier New'; COLOR: blue; FONT-SIZE: 10pt; mso-fareast-font-family: 'Times New Roman'; mso-ansi-: EN-CA" lang=EN-CA>var</SPAN><SPAN style="FONT-FAMILY: 'Courier New'; COLOR: black; FONT-SIZE: 10pt; mso-fareast-font-family: 'Times New Roman'; mso-ansi-: EN-CA" lang=EN-CA> nancy = _dm.Employee.Where(<O:P></O:P></SPAN></P><P style="LINE-HEIGHT: normal; MARGIN: 0in 1.5pt 0pt 0in" ="Ms&#111;normal"><SPAN style="FONT-FAMILY: 'Courier New'; COLOR: blue; FONT-SIZE: 10pt; mso-fareast-font-family: 'Times New Roman'; mso-ansi-: EN-CA" lang=EN-CA><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></SPAN><SPAN style="FONT-FAMILY: 'Courier New'; COLOR: black; FONT-SIZE: 10pt; mso-fareast-font-family: 'Times New Roman'; mso-ansi-: EN-CA" lang=EN-CA>e =&gt; e.LastName == </SPAN><SPAN style="FONT-FAMILY: 'Courier New'; COLOR: #a31515; FONT-SIZE: 10pt; mso-fareast-font-family: 'Times New Roman'; mso-ansi-: EN-CA" lang=EN-CA>"Davolio"</SPAN><SPAN style="FONT-FAMILY: 'Courier New'; COLOR: black; FONT-SIZE: 10pt; mso-fareast-font-family: 'Times New Roman'; mso-ansi-: EN-CA" lang=EN-CA> ).First();<O:P></O:P></SPAN></P><P style="LINE-HEIGHT: normal; MARGIN: 0in 1.5pt 0pt 0in" ="Ms&#111;normal"><SPAN style="FONT-FAMILY: 'Courier New'; COLOR: black; FONT-SIZE: 10pt; mso-fareast-font-family: 'Times New Roman'; mso-ansi-: EN-CA" lang=EN-CA>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="FONT-FAMILY: 'Courier New'; COLOR: blue; FONT-SIZE: 10pt; mso-fareast-font-family: 'Times New Roman'; mso-ansi-: EN-CA" lang=EN-CA>var</SPAN><SPAN style="FONT-FAMILY: 'Courier New'; COLOR: black; FONT-SIZE: 10pt; mso-fareast-font-family: 'Times New Roman'; mso-ansi-: EN-CA" lang=EN-CA> originallastname = nancy.LastName;<O:P></O:P></SPAN></P><P style="LINE-HEIGHT: normal; MARGIN: 0in 1.5pt 0pt 0in" ="Ms&#111;normal"><SPAN style="FONT-FAMILY: 'Courier New'; COLOR: black; FONT-SIZE: 10pt; mso-fareast-font-family: 'Times New Roman'; mso-ansi-: EN-CA" lang=EN-CA>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; nancy.LastName = </SPAN><SPAN style="FONT-FAMILY: 'Courier New'; COLOR: #a31515; FONT-SIZE: 10pt; mso-fareast-font-family: 'Times New Roman'; mso-ansi-: EN-CA" lang=EN-CA>"Smith"</SPAN><SPAN style="FONT-FAMILY: 'Courier New'; COLOR: black; FONT-SIZE: 10pt; mso-fareast-font-family: 'Times New Roman'; mso-ansi-: EN-CA" lang=EN-CA>;<O:P></O:P></SPAN></P><P style="LINE-HEIGHT: normal; MARGIN: 0in 1.5pt 0pt 0in" ="Ms&#111;normal"><SPAN style="FONT-FAMILY: 'Courier New'; COLOR: black; FONT-SIZE: 10pt; mso-fareast-font-family: 'Times New Roman'; mso-ansi-: EN-CA" lang=EN-CA><O:P>&nbsp;</O:P></SPAN></P><P style="LINE-HEIGHT: normal; MARGIN: 0in 1.5pt 0pt 0in" ="Ms&#111;normal"><SPAN style="FONT-FAMILY: 'Courier New'; COLOR: black; FONT-SIZE: 10pt; mso-fareast-font-family: 'Times New Roman'; mso-ansi-: EN-CA" lang=EN-CA><O:P>&nbsp;</O:P></SPAN></P><P style="LINE-HEIGHT: normal; MARGIN: 0in 1.5pt 0pt 0in" ="Ms&#111;normal"><SPAN style="FONT-FAMILY: 'Courier New'; COLOR: black; FONT-SIZE: 10pt; mso-fareast-font-family: 'Times New Roman'; mso-ansi-: EN-CA" lang=EN-CA>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="FONT-FAMILY: 'Courier New'; COLOR: blue; FONT-SIZE: 10pt; mso-fareast-font-family: 'Times New Roman'; mso-ansi-: EN-CA" lang=EN-CA>var</SPAN><SPAN style="FONT-FAMILY: 'Courier New'; COLOR: black; FONT-SIZE: 10pt; mso-fareast-font-family: 'Times New Roman'; mso-ansi-: EN-CA" lang=EN-CA> nancy4q = _dm.Employee.Where(e =&gt; e.LastName == </SPAN><SPAN style="FONT-FAMILY: 'Courier New'; COLOR: #a31515; FONT-SIZE: 10pt; mso-fareast-font-family: 'Times New Roman'; mso-ansi-: EN-CA" lang=EN-CA>"Davolio"</SPAN><SPAN style="FONT-FAMILY: 'Courier New'; COLOR: black; FONT-SIZE: 10pt; mso-fareast-font-family: 'Times New Roman'; mso-ansi-: EN-CA" lang=EN-CA>);<O:P></O:P></SPAN></P><P style="LINE-HEIGHT: normal; MARGIN: 0in 1.5pt 0pt 0in" ="Ms&#111;normal"><SPAN style="FONT-FAMILY: 'Courier New'; COLOR: black; FONT-SIZE: 10pt; mso-fareast-font-family: 'Times New Roman'; mso-ansi-: EN-CA" lang=EN-CA>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; nancy4q.QueryStrategy = </SPAN><SPAN style="FONT-FAMILY: 'Courier New'; COLOR: #2b91af; FONT-SIZE: 10pt; mso-fareast-font-family: 'Times New Roman'; mso-ansi-: EN-CA" lang=EN-CA>QueryStrategy</SPAN><SPAN style="FONT-FAMILY: 'Courier New'; COLOR: black; FONT-SIZE: 10pt; mso-fareast-font-family: 'Times New Roman'; mso-ansi-: EN-CA" lang=EN-CA>.Normal;<O:P></O:P></SPAN></P><P style="LINE-HEIGHT: normal; MARGIN: 0in 1.5pt 0pt 0in" ="Ms&#111;normal"><SPAN style="FONT-FAMILY: 'Courier New'; COLOR: black; FONT-SIZE: 10pt; mso-fareast-font-family: 'Times New Roman'; mso-ansi-: EN-CA" lang=EN-CA>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="FONT-FAMILY: 'Courier New'; COLOR: blue; FONT-SIZE: 10pt; mso-fareast-font-family: 'Times New Roman'; mso-ansi-: EN-CA" lang=EN-CA>var</SPAN><SPAN style="FONT-FAMILY: 'Courier New'; COLOR: black; FONT-SIZE: 10pt; mso-fareast-font-family: 'Times New Roman'; mso-ansi-: EN-CA" lang=EN-CA> nancy4 = nancy4q.FirstOrNullEntity();<O:P></O:P></SPAN></P><P style="LINE-HEIGHT: normal; MARGIN: 0in 1.5pt 0pt 0in" ="Ms&#111;normal"><SPAN style="FONT-FAMILY: 'Courier New'; COLOR: black; FONT-SIZE: 10pt; mso-fareast-font-family: 'Times New Roman'; mso-ansi-: EN-CA" lang=EN-CA>&nbsp;&nbsp;&nbsp;&nbsp; <O:P></O:P></SPAN></P><P style="LINE-HEIGHT: normal; MARGIN: 0in 1.5pt 0pt 0in" ="Ms&#111;normal"><SPAN style="FONT-FAMILY: 'Courier New'; COLOR: black; FONT-SIZE: 10pt; mso-fareast-font-family: 'Times New Roman'; mso-ansi-: EN-CA" lang=EN-CA>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="FONT-FAMILY: 'Courier New'; COLOR: blue; FONT-SIZE: 10pt; mso-fareast-font-family: 'Times New Roman'; mso-ansi-: EN-CA" lang=EN-CA>var</SPAN><SPAN style="FONT-FAMILY: 'Courier New'; COLOR: black; FONT-SIZE: 10pt; mso-fareast-font-family: 'Times New Roman'; mso-ansi-: EN-CA" lang=EN-CA> lastname4 = nancy4.LastName;<O:P></O:P></SPAN></P><P style="LINE-HEIGHT: normal; MARGIN: 0in 1.5pt 0pt 0in" ="Ms&#111;normal"><SPAN style="FONT-FAMILY: 'Courier New'; COLOR: black; FONT-SIZE: 10pt; mso-fareast-font-family: 'Times New Roman'; mso-ansi-: EN-CA" lang=EN-CA>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="FONT-FAMILY: 'Courier New'; COLOR: #2b91af; FONT-SIZE: 10pt; mso-fareast-font-family: 'Times New Roman'; mso-ansi-: EN-CA" lang=EN-CA>Assert</SPAN><SPAN style="FONT-FAMILY: 'Courier New'; COLOR: black; FONT-SIZE: 10pt; mso-fareast-font-family: 'Times New Roman'; mso-ansi-: EN-CA" lang=EN-CA>.IsTrue(nancy4.EntityAspect.IsNullEntity);<O:P></O:P></SPAN></P><P style="LINE-HEIGHT: normal; MARGIN: 0in 1.5pt 0pt 0in" ="Ms&#111;normal"><SPAN style="FONT-FAMILY: 'Courier New'; COLOR: black; FONT-SIZE: 10pt; mso-fareast-font-family: 'Times New Roman'; mso-ansi-: EN-CA" lang=EN-CA>&nbsp;&nbsp;&nbsp;&nbsp; <O:P></O:P></SPAN></P><P style="LINE-HEIGHT: normal; MARGIN: 0in 1.5pt 0pt 0in" ="Ms&#111;normal"><SPAN style="FONT-FAMILY: 'Courier New'; COLOR: black; FONT-SIZE: 10pt; mso-fareast-font-family: 'Times New Roman'; mso-ansi-: EN-CA" lang=EN-CA>&nbsp; }<O:P></O:P></SPAN></P><P style="LINE-HEIGHT: normal; MARGIN: 0in 1.5pt 0pt" ="Ms&#111;normal"><SPAN style="FONT-FAMILY: 'Times New Roman','serif'; COLOR: #1f497d; FONT-SIZE: 12pt; mso-fareast-font-family: 'Times New Roman'; mso-ansi-: EN-CA" lang=EN-CA><O:P>&nbsp;</O:P></SPAN></P><P style="LINE-HEIGHT: normal; MARGIN: 0in 1.5pt 0pt" ="Ms&#111;normal"><SPAN style="FONT-FAMILY: 'Courier New'; COLOR: black; FONT-SIZE: 10pt; mso-fareast-font-family: 'Times New Roman'; mso-ansi-: EN-CA" lang=EN-CA><SPAN style="mso-spacerun: yes">&nbsp; </SPAN>&#091;</SPAN><SPAN style="FONT-FAMILY: 'Courier New'; COLOR: #2b91af; FONT-SIZE: 10pt; mso-fareast-font-family: 'Times New Roman'; mso-ansi-: EN-CA" lang=EN-CA>TestMethod</SPAN><SPAN style="FONT-FAMILY: 'Courier New'; COLOR: black; FONT-SIZE: 10pt; mso-fareast-font-family: 'Times New Roman'; mso-ansi-: EN-CA" lang=EN-CA>&#093;<O:P></O:P></SPAN></P><P style="LINE-HEIGHT: normal; MARGIN: 0in 1.5pt 0pt" ="Ms&#111;normal"><SPAN style="FONT-FAMILY: 'Courier New'; COLOR: black; FONT-SIZE: 10pt; mso-fareast-font-family: 'Times New Roman'; mso-ansi-: EN-CA" lang=EN-CA>&nbsp; </SPAN><SPAN style="FONT-FAMILY: 'Courier New'; COLOR: blue; FONT-SIZE: 10pt; mso-fareast-font-family: 'Times New Roman'; mso-ansi-: EN-CA" lang=EN-CA>public</SPAN><SPAN style="FONT-FAMILY: 'Courier New'; COLOR: black; FONT-SIZE: 10pt; mso-fareast-font-family: 'Times New Roman'; mso-ansi-: EN-CA" lang=EN-CA> </SPAN><SPAN style="FONT-FAMILY: 'Courier New'; COLOR: blue; FONT-SIZE: 10pt; mso-fareast-font-family: 'Times New Roman'; mso-ansi-: EN-CA" lang=EN-CA>void</SPAN><SPAN style="FONT-FAMILY: 'Courier New'; COLOR: black; FONT-SIZE: 10pt; mso-fareast-font-family: 'Times New Roman'; mso-ansi-: EN-CA" lang=EN-CA> DataSourceThenCacheTest()<O:P></O:P></SPAN></P><P style="LINE-HEIGHT: normal; MARGIN: 0in 1.5pt 0pt" ="Ms&#111;normal"><SPAN style="FONT-FAMILY: 'Courier New'; COLOR: black; FONT-SIZE: 10pt; mso-fareast-font-family: 'Times New Roman'; mso-ansi-: EN-CA" lang=EN-CA>&nbsp; {<O:P></O:P></SPAN></P><P style="LINE-HEIGHT: normal; MARGIN: 0in 1.5pt 0pt" ="Ms&#111;normal"><SPAN style="FONT-FAMILY: 'Courier New'; COLOR: black; FONT-SIZE: 10pt; mso-fareast-font-family: 'Times New Roman'; mso-ansi-: EN-CA" lang=EN-CA><SPAN style="mso-spacerun: yes">&nbsp;</SPAN>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="FONT-FAMILY: 'Courier New'; COLOR: green; FONT-SIZE: 10pt; mso-fareast-font-family: 'Times New Roman'; mso-ansi-: EN-CA" lang=EN-CA>//<O:P></O:P></SPAN></P><P style="LINE-HEIGHT: normal; MARGIN: 0in 1.5pt 0pt" ="Ms&#111;normal"><SPAN style="FONT-FAMILY: 'Courier New'; COLOR: black; FONT-SIZE: 10pt; mso-fareast-font-family: 'Times New Roman'; mso-ansi-: EN-CA" lang=EN-CA>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="FONT-FAMILY: 'Courier New'; COLOR: green; FONT-SIZE: 10pt; mso-fareast-font-family: 'Times New Roman'; mso-ansi-: EN-CA" lang=EN-CA>// TODO: Add test logic here<O:P></O:P></SPAN></P><P style="LINE-HEIGHT: normal; MARGIN: 0in 1.5pt 0pt" ="Ms&#111;normal"><SPAN style="FONT-FAMILY: 'Courier New'; COLOR: black; FONT-SIZE: 10pt; mso-fareast-font-family: 'Times New Roman'; mso-ansi-: EN-CA" lang=EN-CA>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="FONT-FAMILY: 'Courier New'; COLOR: green; FONT-SIZE: 10pt; mso-fareast-font-family: 'Times New Roman'; mso-ansi-: EN-CA" lang=EN-CA>//<O:P></O:P></SPAN></P><P style="LINE-HEIGHT: normal; MARGIN: 0in 1.5pt 0pt" ="Ms&#111;normal"><SPAN style="FONT-FAMILY: 'Courier New'; COLOR: black; FONT-SIZE: 10pt; mso-fareast-font-family: 'Times New Roman'; mso-ansi-: EN-CA" lang=EN-CA>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="FONT-FAMILY: 'Courier New'; COLOR: blue; FONT-SIZE: 10pt; mso-fareast-font-family: 'Times New Roman'; mso-ansi-: EN-CA" lang=EN-CA>var</SPAN><SPAN style="FONT-FAMILY: 'Courier New'; COLOR: black; FONT-SIZE: 10pt; mso-fareast-font-family: 'Times New Roman'; mso-ansi-: EN-CA" lang=EN-CA> _dm = </SPAN><SPAN style="FONT-FAMILY: 'Courier New'; COLOR: #2b91af; FONT-SIZE: 10pt; mso-fareast-font-family: 'Times New Roman'; mso-ansi-: EN-CA" lang=EN-CA>DomainModelEntityManager</SPAN><SPAN style="FONT-FAMILY: 'Courier New'; COLOR: black; FONT-SIZE: 10pt; mso-fareast-font-family: 'Times New Roman'; mso-ansi-: EN-CA" lang=EN-CA>.DefaultManager;<O:P></O:P></SPAN></P><P style="LINE-HEIGHT: normal; MARGIN: 0in 1.5pt 0pt" ="Ms&#111;normal"><SPAN style="FONT-FAMILY: 'Courier New'; COLOR: black; FONT-SIZE: 10pt; mso-fareast-font-family: 'Times New Roman'; mso-ansi-: EN-CA" lang=EN-CA>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="FONT-FAMILY: 'Courier New'; COLOR: blue; FONT-SIZE: 10pt; mso-fareast-font-family: 'Times New Roman'; mso-ansi-: EN-CA" lang=EN-CA>var</SPAN><SPAN style="FONT-FAMILY: 'Courier New'; COLOR: black; FONT-SIZE: 10pt; mso-fareast-font-family: 'Times New Roman'; mso-ansi-: EN-CA" lang=EN-CA> nancy = _dm.Employee.Where(<O:P></O:P></SPAN></P><P style="LINE-HEIGHT: normal; MARGIN: 0in 1.5pt 0pt" ="Ms&#111;normal"><SPAN style="FONT-FAMILY: 'Courier New'; COLOR: blue; FONT-SIZE: 10pt; mso-fareast-font-family: 'Times New Roman'; mso-ansi-: EN-CA" lang=EN-CA><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="mso-spacerun: yes">&nbsp;</SPAN></SPAN><SPAN style="FONT-FAMILY: 'Courier New'; COLOR: black; FONT-SIZE: 10pt; mso-fareast-font-family: 'Times New Roman'; mso-ansi-: EN-CA" lang=EN-CA>e =&gt; e.LastName == </SPAN><SPAN style="FONT-FAMILY: 'Courier New'; COLOR: #a31515; FONT-SIZE: 10pt; mso-fareast-font-family: 'Times New Roman'; mso-ansi-: EN-CA" lang=EN-CA>"Davolio"</SPAN><SPAN style="FONT-FAMILY: 'Courier New'; COLOR: black; FONT-SIZE: 10pt; mso-fareast-font-family: 'Times New Roman'; mso-ansi-: EN-CA" lang=EN-CA>).First();<O:P></O:P></SPAN></P><P style="LINE-HEIGHT: normal; MARGIN: 0in 1.5pt 0pt" ="Ms&#111;normal"><SPAN style="FONT-FAMILY: 'Courier New'; COLOR: black; FONT-SIZE: 10pt; mso-fareast-font-family: 'Times New Roman'; mso-ansi-: EN-CA" lang=EN-CA>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="FONT-FAMILY: 'Courier New'; COLOR: blue; FONT-SIZE: 10pt; mso-fareast-font-family: 'Times New Roman'; mso-ansi-: EN-CA" lang=EN-CA>var</SPAN><SPAN style="FONT-FAMILY: 'Courier New'; COLOR: black; FONT-SIZE: 10pt; mso-fareast-font-family: 'Times New Roman'; mso-ansi-: EN-CA" lang=EN-CA> originallastname = nancy.LastName;<O:P></O:P></SPAN></P><P style="LINE-HEIGHT: normal; MARGIN: 0in 1.5pt 0pt" ="Ms&#111;normal"><SPAN style="FONT-FAMILY: 'Courier New'; COLOR: black; FONT-SIZE: 10pt; mso-fareast-font-family: 'Times New Roman'; mso-ansi-: EN-CA" lang=EN-CA>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <O:P></O:P></SPAN></P><P style="LINE-HEIGHT: normal; MARGIN: 0in 1.5pt 0pt" ="Ms&#111;normal"><SPAN style="FONT-FAMILY: 'Courier New'; COLOR: black; FONT-SIZE: 10pt; mso-fareast-font-family: 'Times New Roman'; mso-ansi-: EN-CA" lang=EN-CA>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;nancy.LastName = </SPAN><SPAN style="FONT-FAMILY: 'Courier New'; COLOR: #a31515; FONT-SIZE: 10pt; mso-fareast-font-family: 'Times New Roman'; mso-ansi-: EN-CA" lang=EN-CA>"Smith"</SPAN><SPAN style="FONT-FAMILY: 'Courier New'; COLOR: black; FONT-SIZE: 10pt; mso-fareast-font-family: 'Times New Roman'; mso-ansi-: EN-CA" lang=EN-CA>;<O:P></O:P></SPAN></P><P style="LINE-HEIGHT: normal; MARGIN: 0in 1.5pt 0pt" ="Ms&#111;normal"><SPAN style="FONT-FAMILY: 'Courier New'; COLOR: black; FONT-SIZE: 10pt; mso-fareast-font-family: 'Times New Roman'; mso-ansi-: EN-CA" lang=EN-CA><O:P>&nbsp;</O:P></SPAN></P><P style="LINE-HEIGHT: normal; MARGIN: 0in 1.5pt 0pt" ="Ms&#111;normal"><SPAN style="FONT-FAMILY: 'Courier New'; COLOR: black; FONT-SIZE: 10pt; mso-fareast-font-family: 'Times New Roman'; mso-ansi-: EN-CA" lang=EN-CA>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="FONT-FAMILY: 'Courier New'; COLOR: blue; FONT-SIZE: 10pt; mso-fareast-font-family: 'Times New Roman'; mso-ansi-: EN-CA" lang=EN-CA>var</SPAN><SPAN style="FONT-FAMILY: 'Courier New'; COLOR: black; FONT-SIZE: 10pt; mso-fareast-font-family: 'Times New Roman'; mso-ansi-: EN-CA" lang=EN-CA> nancy4q = _dm.Employee.Where(e =&gt; e.LastName == </SPAN><SPAN style="FONT-FAMILY: 'Courier New'; COLOR: #a31515; FONT-SIZE: 10pt; mso-fareast-font-family: 'Times New Roman'; mso-ansi-: EN-CA" lang=EN-CA>"Davolio"</SPAN><SPAN style="FONT-FAMILY: 'Courier New'; COLOR: black; FONT-SIZE: 10pt; mso-fareast-font-family: 'Times New Roman'; mso-ansi-: EN-CA" lang=EN-CA>);<O:P></O:P></SPAN></P><P style="LINE-HEIGHT: normal; MARGIN: 0in 1.5pt 0pt" ="Ms&#111;normal"><SPAN style="FONT-FAMILY: 'Courier New'; COLOR: black; FONT-SIZE: 10pt; mso-fareast-font-family: 'Times New Roman'; mso-ansi-: EN-CA" lang=EN-CA>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;nancy4q.QueryStrategy = </SPAN><SPAN style="FONT-FAMILY: 'Courier New'; COLOR: #2b91af; FONT-SIZE: 10pt; mso-fareast-font-family: 'Times New Roman'; mso-ansi-: EN-CA" lang=EN-CA>QueryStrategy</SPAN><SPAN style="FONT-FAMILY: 'Courier New'; COLOR: black; FONT-SIZE: 10pt; mso-fareast-font-family: 'Times New Roman'; mso-ansi-: EN-CA" lang=EN-CA>.DataSourceThenCache;<O:P></O:P></SPAN></P><P style="LINE-HEIGHT: normal; MARGIN: 0in 1.5pt 0pt" ="Ms&#111;normal"><SPAN style="FONT-FAMILY: 'Courier New'; COLOR: black; FONT-SIZE: 10pt; mso-fareast-font-family: 'Times New Roman'; mso-ansi-: EN-CA" lang=EN-CA>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="FONT-FAMILY: 'Courier New'; COLOR: blue; FONT-SIZE: 10pt; mso-fareast-font-family: 'Times New Roman'; mso-ansi-: EN-CA" lang=EN-CA>var</SPAN><SPAN style="FONT-FAMILY: 'Courier New'; COLOR: black; FONT-SIZE: 10pt; mso-fareast-font-family: 'Times New Roman'; mso-ansi-: EN-CA" lang=EN-CA> nancy4 = nancy4q.FirstOrNullEntity();<O:P></O:P></SPAN></P><P style="LINE-HEIGHT: normal; MARGIN: 0in 1.5pt 0pt" ="Ms&#111;normal"><SPAN style="FONT-FAMILY: 'Courier New'; COLOR: black; FONT-SIZE: 10pt; mso-fareast-font-family: 'Times New Roman'; mso-ansi-: EN-CA" lang=EN-CA>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<O:P></O:P></SPAN></P><P style="LINE-HEIGHT: normal; MARGIN: 0in 1.5pt 0pt" ="Ms&#111;normal"><SPAN style="FONT-FAMILY: 'Courier New'; COLOR: black; FONT-SIZE: 10pt; mso-fareast-font-family: 'Times New Roman'; mso-ansi-: EN-CA" lang=EN-CA>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="FONT-FAMILY: 'Courier New'; COLOR: blue; FONT-SIZE: 10pt; mso-fareast-font-family: 'Times New Roman'; mso-ansi-: EN-CA" lang=EN-CA>var</SPAN><SPAN style="FONT-FAMILY: 'Courier New'; COLOR: black; FONT-SIZE: 10pt; mso-fareast-font-family: 'Times New Roman'; mso-ansi-: EN-CA" lang=EN-CA> lastname4 = nancy4.LastName;<O:P></O:P></SPAN></P><P style="LINE-HEIGHT: normal; MARGIN: 0in 1.5pt 0pt" ="Ms&#111;normal"><SPAN style="FONT-FAMILY: 'Courier New'; COLOR: black; FONT-SIZE: 10pt; mso-fareast-font-family: 'Times New Roman'; mso-ansi-: EN-CA" lang=EN-CA>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="FONT-FAMILY: 'Courier New'; COLOR: #2b91af; FONT-SIZE: 10pt; mso-fareast-font-family: 'Times New Roman'; mso-ansi-: EN-CA" lang=EN-CA>Assert</SPAN><SPAN style="FONT-FAMILY: 'Courier New'; COLOR: black; FONT-SIZE: 10pt; mso-fareast-font-family: 'Times New Roman'; mso-ansi-: EN-CA" lang=EN-CA>.IsTrue(lastname4 == originallastname);<O:P></O:P></SPAN></P><P style="LINE-HEIGHT: normal; MARGIN: 0in 1.5pt 0pt" ="Ms&#111;normal"><SPAN style="FONT-FAMILY: 'Courier New'; COLOR: #2b91af; FONT-SIZE: 10pt; mso-fareast-font-family: 'Times New Roman'; mso-ansi-: EN-CA" lang=EN-CA><SPAN style="mso-spacerun: yes">&nbsp; </SPAN></SPAN><SPAN style="FONT-FAMILY: 'Courier New'; COLOR: black; FONT-SIZE: 10pt; mso-fareast-font-family: 'Times New Roman'; mso-ansi-: EN-CA" lang=EN-CA>}<O:P></O:P></SPAN></P><P style="LINE-HEIGHT: normal; MARGIN: 0in 1.5pt 0pt" ="Ms&#111;normal"><FONT face=Calibri><SPAN style="COLOR: #1f497d; FONT-SIZE: 12pt; mso-fareast-font-family: 'Times New Roman'; mso-ascii-font-family: Calibri; mso-hansi-font-family: Calibri; mso-bidi-font-family: Calibri; mso-ansi-: EN" lang=EN>&nbsp;----</SPAN><SPAN style="FONT-FAMILY: 'Times New Roman','serif'; COLOR: #1f497d; FONT-SIZE: 12pt; mso-fareast-font-family: 'Times New Roman'; mso-ansi-: EN" lang=EN><O:P></O:P></SPAN></FONT></P><P style="LINE-HEIGHT: normal; MARGIN: 0in 1.5pt 0pt" ="Ms&#111;normal"><B><SPAN style="FONT-FAMILY: 'Tahoma','sans-serif'; COLOR: black; FONT-SIZE: 10pt; mso-fareast-font-family: 'Times New Roman'; mso-ansi-: EN" lang=EN>From:</SPAN></B><SPAN style="FONT-FAMILY: 'Tahoma','sans-serif'; COLOR: black; FONT-SIZE: 10pt; mso-fareast-font-family: 'Times New Roman'; mso-ansi-: EN" lang=EN> Ward Bell <BR><B>Sent:</B> Tuesday, August 11, 2009 3:06 PM<BR></SPAN><FONT face=Calibri><SPAN style="COLOR: #1f497d; FONT-SIZE: 12pt; mso-themecolor: dark2; mso-fareast-font-family: 'Times New Roman'; mso-ascii-font-family: Calibri; mso-hansi-font-family: Calibri; mso-bidi-font-family: Calibri; mso-ansi-: EN" lang=EN>Perhaps</SPAN><SPAN style="COLOR: #1f497d; FONT-SIZE: 12pt; mso-fareast-font-family: 'Times New Roman'; mso-ascii-font-family: Calibri; mso-hansi-font-family: Calibri; mso-bidi-font-family: Calibri; mso-ansi-: EN" lang=EN> you’ve discovered a bug. You have at least discovered anomalous behavior that deserves justification.<O:P></O:P></SPAN></FONT></P><P style="LINE-HEIGHT: normal; MARGIN: 0in 1.5pt 0pt" ="Ms&#111;normal"><SPAN style="FONT-FAMILY: 'Times New Roman','serif'; COLOR: #1f497d; FONT-SIZE: 12pt; mso-fareast-font-family: 'Times New Roman'; mso-ansi-: EN" lang=EN><O:P>&nbsp;</O:P></SPAN></P><P style="LINE-HEIGHT: normal; MARGIN: 0in 1.5pt 0pt" ="Ms&#111;normal"><SPAN style="COLOR: #1f497d; FONT-SIZE: 12pt; mso-fareast-font-family: 'Times New Roman'; mso-ascii-font-family: Calibri; mso-hansi-font-family: Calibri; mso-bidi-font-family: Calibri; mso-ansi-: EN" lang=EN><FONT face=Calibri>In your second “DatasourceThenCache” test you look for “Davolio” and find her in the database. You merge the changes … whereupon it is evident that she (employee.Id==1) is “Smith”. After the query has been run against the cache (as part of the “…ThenCache” phase), I would have expected it to return a null entity … because there is no “Davolio” in the cache.<O:P></O:P></FONT></SPAN></P><P style="LINE-HEIGHT: normal; MARGIN: 0in 1.5pt 0pt" ="Ms&#111;normal"><SPAN style="FONT-FAMILY: 'Times New Roman','serif'; COLOR: #1f497d; FONT-SIZE: 12pt; mso-fareast-font-family: 'Times New Roman'; mso-ansi-: EN" lang=EN><O:P>&nbsp;</O:P></SPAN></P><P style="LINE-HEIGHT: normal; MARGIN: 0in 1.5pt 0pt" ="Ms&#111;normal"><SPAN style="COLOR: #1f497d; FONT-SIZE: 12pt; mso-fareast-font-family: 'Times New Roman'; mso-ascii-font-family: Calibri; mso-hansi-font-family: Calibri; mso-bidi-font-family: Calibri; mso-ansi-: EN" lang=EN><FONT face=Calibri>In other words, “Normal” and “DatasourceThenCache” should return the same result. The only difference should have been that “DatasourceThenCache” made a trip to the database.<O:P></O:P></FONT></SPAN></P><P style="LINE-HEIGHT: normal; MARGIN: 0in 1.5pt 0pt" ="Ms&#111;normal"><SPAN style="FONT-FAMILY: 'Times New Roman','serif'; COLOR: #1f497d; FONT-SIZE: 12pt; mso-fareast-font-family: 'Times New Roman'; mso-ansi-: EN" lang=EN><O:P>&nbsp;</O:P></SPAN></P><P style="LINE-HEIGHT: normal; MARGIN: 0in 1.5pt 0pt" ="Ms&#111;normal"><FONT face=Calibri><SPAN style="COLOR: #1f497d; FONT-SIZE: 12pt; mso-fareast-font-family: 'Times New Roman'; mso-ascii-font-family: Calibri; mso-hansi-font-family: Calibri; mso-bidi-font-family: Calibri; mso-ansi-: EN" lang=EN>What is wrong with my expectation</SPAN><SPAN style="COLOR: #1f497d; FONT-SIZE: 12pt; mso-themecolor: dark2; mso-fareast-font-family: 'Times New Roman'; mso-ascii-font-family: Calibri; mso-hansi-font-family: Calibri; mso-bidi-font-family: Calibri; mso-ansi-: EN" lang=EN>? I thought</SPAN><SPAN style="COLOR: #1f497d; FONT-SIZE: 12pt; mso-fareast-font-family: 'Times New Roman'; mso-ascii-font-family: Calibri; mso-hansi-font-family: Calibri; mso-bidi-font-family: Calibri; mso-ansi-: EN" lang=EN> that “DatasourceThenCache” should be understood as follows:<O:P></O:P></SPAN></FONT></P><P style="LINE-HEIGHT: normal; TEXT-INDENT: -0.25in; MARGIN: 0in 1.5pt 0pt 37.5pt" ="Ms&#111;normal"><SPAN style="FONT-FAMILY: Symbol; COLOR: #1f497d; FONT-SIZE: 12pt; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol; mso-ansi-: EN" lang=EN>·</SPAN><SPAN style="FONT-FAMILY: 'Times New Roman','serif'; COLOR: #1f497d; FONT-SIZE: 7pt; mso-fareast-font-family: Symbol; mso-ansi-: EN" lang=EN>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="COLOR: #1f497d; FONT-SIZE: 12pt; mso-fareast-font-family: 'Times New Roman'; mso-ascii-font-family: Calibri; mso-hansi-font-family: Calibri; mso-bidi-font-family: Calibri; mso-ansi-: EN" lang=EN><FONT face=Calibri>Force query on the database<O:P></O:P></FONT></SPAN></P><P style="LINE-HEIGHT: normal; TEXT-INDENT: -0.25in; MARGIN: 0in 1.5pt 0pt 37.5pt" ="Ms&#111;normal"><SPAN style="FONT-FAMILY: Symbol; COLOR: #1f497d; FONT-SIZE: 12pt; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol; mso-ansi-: EN" lang=EN>·</SPAN><SPAN style="FONT-FAMILY: 'Times New Roman','serif'; COLOR: #1f497d; FONT-SIZE: 7pt; mso-fareast-font-family: Symbol; mso-ansi-: EN" lang=EN>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="COLOR: #1f497d; FONT-SIZE: 12pt; mso-fareast-font-family: 'Times New Roman'; mso-ascii-font-family: Calibri; mso-hansi-font-family: Calibri; mso-bidi-font-family: Calibri; mso-ansi-: EN" lang=EN><FONT face=Calibri>Merge results with the cache<O:P></O:P></FONT></SPAN></P><P style="LINE-HEIGHT: normal; TEXT-INDENT: -0.25in; MARGIN: 0in 1.5pt 0pt 37.5pt" ="Ms&#111;normal"><SPAN style="FONT-FAMILY: Symbol; COLOR: #1f497d; FONT-SIZE: 12pt; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol; mso-ansi-: EN" lang=EN>·</SPAN><SPAN style="FONT-FAMILY: 'Times New Roman','serif'; COLOR: #1f497d; FONT-SIZE: 7pt; mso-fareast-font-family: Symbol; mso-ansi-: EN" lang=EN>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="COLOR: #1f497d; FONT-SIZE: 12pt; mso-fareast-font-family: 'Times New Roman'; mso-ascii-font-family: Calibri; mso-hansi-font-family: Calibri; mso-bidi-font-family: Calibri; mso-ansi-: EN" lang=EN><FONT face=Calibri>Ignore the database query results<O:P></O:P></FONT></SPAN></P><P style="LINE-HEIGHT: normal; TEXT-INDENT: -0.25in; MARGIN: 0in 1.5pt 0pt 37.5pt" ="Ms&#111;normal"><SPAN style="FONT-FAMILY: Symbol; COLOR: #1f497d; FONT-SIZE: 12pt; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol; mso-ansi-: EN" lang=EN>·</SPAN><SPAN style="FONT-FAMILY: 'Times New Roman','serif'; COLOR: #1f497d; FONT-SIZE: 7pt; mso-fareast-font-family: Symbol; mso-ansi-: EN" lang=EN>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="COLOR: #1f497d; FONT-SIZE: 12pt; mso-fareast-font-family: 'Times New Roman'; mso-ascii-font-family: Calibri; mso-hansi-font-family: Calibri; mso-bidi-font-family: Calibri; mso-ansi-: EN" lang=EN><FONT face=Calibri>Re-apply the query as if cache-only<O:P></O:P></FONT></SPAN></P><P style="LINE-HEIGHT: normal; TEXT-INDENT: -0.25in; MARGIN: 0in 1.5pt 0pt 37.5pt" ="Ms&#111;normal"><SPAN style="FONT-FAMILY: Symbol; COLOR: #1f497d; FONT-SIZE: 12pt; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol; mso-ansi-: EN" lang=EN>·</SPAN><SPAN style="FONT-FAMILY: 'Times New Roman','serif'; COLOR: #1f497d; FONT-SIZE: 7pt; mso-fareast-font-family: Symbol; mso-ansi-: EN" lang=EN>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="COLOR: #1f497d; FONT-SIZE: 12pt; mso-fareast-font-family: 'Times New Roman'; mso-ascii-font-family: Calibri; mso-hansi-font-family: Calibri; mso-bidi-font-family: Calibri; mso-ansi-: EN" lang=EN><FONT face=Calibri>Return the cache-only query results<O:P></O:P></FONT></SPAN></P><P style="LINE-HEIGHT: normal; MARGIN: 0in 1.5pt 0pt" ="Ms&#111;normal"><SPAN style="FONT-FAMILY: 'Times New Roman','serif'; COLOR: #1f497d; FONT-SIZE: 12pt; mso-fareast-font-family: 'Times New Roman'; mso-ansi-: EN" lang=EN><BR></SPAN><SPAN style="COLOR: #1f497d; FONT-SIZE: 12pt; mso-fareast-font-family: 'Times New Roman'; mso-ascii-font-family: Calibri; mso-hansi-font-family: Calibri; mso-bidi-font-family: Calibri; mso-ansi-: EN" lang=EN><FONT face=Calibri>That is obviously not happening if&nbsp;the second query below returns a non-null entity.<O:P></O:P></FONT></SPAN></P><P style="LINE-HEIGHT: normal; MARGIN: 0in 1.5pt 0pt" ="Ms&#111;normal"><B><SPAN style="FONT-FAMILY: 'Tahoma','sans-serif'; COLOR: black; FONT-SIZE: 10pt; mso-fareast-font-family: 'Times New Roman'; mso-ansi-: EN" lang=EN>--<O:P></O:P></SPAN></B></P><P style="LINE-HEIGHT: normal; MARGIN: 0in 1.5pt 0pt" ="Ms&#111;normal"><B><SPAN style="FONT-FAMILY: 'Tahoma','sans-serif'; COLOR: black; FONT-SIZE: 10pt; mso-fareast-font-family: 'Times New Roman'; mso-ansi-: EN" lang=EN>From:</SPAN></B><SPAN style="FONT-FAMILY: 'Tahoma','sans-serif'; COLOR: black; FONT-SIZE: 10pt; mso-fareast-font-family: 'Times New Roman'; mso-ansi-: EN" lang=EN> Ward Bell<BR><B>Sent:</B> Tuesday, August 11, 2009 8:48 PM</SPAN><SPAN style="FONT-FAMILY: 'Times New Roman','serif'; COLOR: black; FONT-SIZE: 12pt; mso-fareast-font-family: 'Times New Roman'; mso-ansi-: EN" lang=EN><O:P></O:P></SPAN></P><P style="LINE-HEIGHT: normal; MARGIN: 0in 1.5pt 0pt" ="Ms&#111;normal"><SPAN style="COLOR: red; FONT-SIZE: 12pt; mso-fareast-font-family: 'Times New Roman'; mso-ascii-font-family: Calibri; mso-hansi-font-family: Calibri; mso-bidi-font-family: Calibri; mso-ansi-: EN" lang=EN><FONT face=Calibri>My comments back to the chief architect<O:P></O:P></FONT></SPAN></P><P style="LINE-HEIGHT: normal; MARGIN: 0in 1.5pt 0pt" ="Ms&#111;normal"><FONT face=Calibri><SPAN style="COLOR: #1f497d; FONT-SIZE: 12pt; mso-fareast-font-family: 'Times New Roman'; mso-ascii-font-family: Calibri; mso-hansi-font-family: Calibri; mso-bidi-font-family: Calibri; mso-ansi-: EN" lang=EN>&nbsp;--</SPAN><SPAN style="FONT-FAMILY: 'Times New Roman','serif'; COLOR: #1f497d; FONT-SIZE: 12pt; mso-fareast-font-family: 'Times New Roman'; mso-ansi-: EN" lang=EN><O:P></O:P></SPAN></FONT></P><P style="LINE-HEIGHT: normal; MARGIN: 0in 1.5pt 0pt" ="Ms&#111;normal"><B><SPAN style="FONT-FAMILY: 'Tahoma','sans-serif'; COLOR: black; FONT-SIZE: 10pt; mso-fareast-font-family: 'Times New Roman'; mso-ansi-: EN" lang=EN>Sent:</SPAN></B><SPAN style="FONT-FAMILY: 'Tahoma','sans-serif'; COLOR: black; FONT-SIZE: 10pt; mso-fareast-font-family: 'Times New Roman'; mso-ansi-: EN" lang=EN> Tuesday, August 11, 2009 6:05 PM<BR><B>To:</B> Ward Bell</SPAN><SPAN style="FONT-FAMILY: 'Times New Roman','serif'; COLOR: black; FONT-SIZE: 12pt; mso-fareast-font-family: 'Times New Roman'; mso-ansi-: EN" lang=EN><O:P></O:P></SPAN></P><P style="LINE-HEIGHT: normal; MARGIN: 0in 1.5pt 0pt" ="Ms&#111;normal"><SPAN style="FONT-FAMILY: 'Times New Roman','serif'; COLOR: black; FONT-SIZE: 12pt; mso-fareast-font-family: 'Times New Roman'; mso-ansi-: EN" lang=EN><O:P>&nbsp;</O:P></SPAN></P><P style="LINE-HEIGHT: normal; MARGIN: 0in 1.5pt 0pt" ="Ms&#111;normal"><SPAN style="COLOR: #1f497d; FONT-SIZE: 12pt; mso-fareast-font-family: 'Times New Roman'; mso-ascii-font-family: Calibri; mso-hansi-font-family: Calibri; mso-bidi-font-family: Calibri; mso-ansi-: EN" lang=EN><FONT face=Calibri>Ward<O:P></O:P></FONT></SPAN></P><P style="LINE-HEIGHT: normal; MARGIN: 0in 1.5pt 0pt" ="Ms&#111;normal"><SPAN style="COLOR: #1f497d; FONT-SIZE: 12pt; mso-fareast-font-family: 'Times New Roman'; mso-ascii-font-family: Calibri; mso-hansi-font-family: Calibri; mso-bidi-font-family: Calibri; mso-ansi-: EN" lang=EN><FONT face=Calibri>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; This is the same as it was in Classic and …. It makes sense.&nbsp; If you are querying “DataSourceOnly” wouldn’t it confuse you if you queried for “Diavolo” and had “Smith” returned?&nbsp; <O:P></O:P></FONT></SPAN></P><P style="LINE-HEIGHT: normal; MARGIN: 0in 1.5pt 0pt" ="Ms&#111;normal"><SPAN style="FONT-FAMILY: 'Times New Roman','serif'; COLOR: #1f497d; FONT-SIZE: 12pt; mso-fareast-font-family: 'Times New Roman'; mso-ansi-: EN" lang=EN><O:P>&nbsp;</O:P></SPAN></P><P style="LINE-HEIGHT: normal; MARGIN: 0in 1.5pt 0pt" ="Ms&#111;normal"><SPAN style="COLOR: red; FONT-SIZE: 12pt; mso-fareast-font-family: 'Times New Roman'; mso-ascii-font-family: Calibri; mso-hansi-font-family: Calibri; mso-bidi-font-family: Calibri; mso-ansi-: EN" lang=EN><FONT face=Calibri>&nbsp; EXACTLY. Which is why I thought it should return NULL ENTITY<O:P></O:P></FONT></SPAN></P><P style="LINE-HEIGHT: normal; MARGIN: 0in 1.5pt 0pt" ="Ms&#111;normal"><SPAN style="FONT-FAMILY: 'Times New Roman','serif'; COLOR: #1f497d; FONT-SIZE: 12pt; mso-fareast-font-family: 'Times New Roman'; mso-ansi-: EN" lang=EN><O:P>&nbsp;</O:P></SPAN></P><P style="LINE-HEIGHT: normal; MARGIN: 0in 1.5pt 0pt" ="Ms&#111;normal"><SPAN style="COLOR: #1f497d; FONT-SIZE: 12pt; mso-fareast-font-family: 'Times New Roman'; mso-ascii-font-family: Calibri; mso-hansi-font-family: Calibri; mso-bidi-font-family: Calibri; mso-ansi-: EN" lang=EN><FONT face=Calibri>Which is what would happen if we had the MergeStrategy for “DataSourceOnly” be PreserveChanges.&nbsp;&nbsp; The main idea behind DataSourceOnly is that you get the entities as they look in the database.<O:P></O:P></FONT></SPAN></P><P style="LINE-HEIGHT: normal; MARGIN: 0in 1.5pt 0pt" ="Ms&#111;normal"><SPAN style="FONT-FAMILY: 'Times New Roman','serif'; COLOR: #1f497d; FONT-SIZE: 12pt; mso-fareast-font-family: 'Times New Roman'; mso-ansi-: EN" lang=EN><O:P>&nbsp;</O:P></SPAN></P><P style="LINE-HEIGHT: normal; MARGIN: 0in 1.5pt 0pt" ="Ms&#111;normal"><FONT face=Calibri><SPAN style="COLOR: red; FONT-SIZE: 12pt; mso-fareast-font-family: 'Times New Roman'; mso-ascii-font-family: Calibri; mso-hansi-font-family: Calibri; mso-bidi-font-family: Calibri; mso-ansi-: EN" lang=EN>&nbsp;I would rather have NULL ENTITY than risk reversing the user’s changes. I concede that reasonable minds may disagree about which is worse. The KEY THING is to know what you’re doing. I’m sure we document it. Like everyone else, I ignore the documentation, fail to test my assumptions, and then I get bitter about it.</SPAN><SPAN style="COLOR: #1f497d; FONT-SIZE: 12pt; mso-themecolor: dark2; mso-fareast-font-family: 'Times New Roman'; mso-ascii-font-family: Calibri; mso-hansi-font-family: Calibri; mso-bidi-font-family: Calibri; mso-ansi-: EN" lang=EN> </SPAN></FONT><SPAN style="FONT-FAMILY: Wingdings; COLOR: #1f497d; FONT-SIZE: 12pt; mso-themecolor: dark2; mso-fareast-font-family: 'Times New Roman'; mso-ascii-font-family: Calibri; mso-hansi-font-family: Calibri; mso-bidi-font-family: 'Times New Roman'; mso-symbol-font-family: Wingdings; mso-ansi-: EN; mso-char-: symbol" lang=EN><SPAN style="mso-symbol-font-family: Wingdings; mso-char-: symbol">J</SPAN></SPAN></P><span style="font-size:10px"><br /><br />Edited by WardBell - 12-Aug-2009 at 12:31pm</span>]]>
   </description>
   <pubDate>Wed, 12 Aug 2009 12:21:51 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=1422&amp;PID=5156#5156</guid>
  </item> 
 </channel>
</rss>