<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:atom="https://www.w3.org/2005/Atom" xmlns:sy="https://purl.org/rss/1.0/modules/syndication/" xmlns:dc="https://purl.org/dc/elements/1.1/" xmlns:content="https://purl.org/rss/1.0/modules/content/" xmlns:wfw="https://wellformedweb.org/CommentAPI/" xmlns:slash="https://purl.org/rss/1.0/modules/slash/"
  version="2.0">
  <channel>
    <title>davidobando</title>
    <atom:link
      href="https://docs.microsoft.com/archive/blogs/davidobando/feed.xml"
      rel="self"
      type="application/rss+xml" />
    <link>https://docs.microsoft.com/archive/blogs/davidobando/feed.xml</link>
    <description />
    <lastBuildDate>Wed, 17 Apr 2019 03:20:24 GMT</lastBuildDate>
    <language>en-US</language>
    <sy:updatePeriod>hourly</sy:updatePeriod>
    <sy:updateFrequency>1</sy:updateFrequency>
    <item>
      <title>Override bitlocker PIN entry during reboot</title>
      <link>https://docs.microsoft.com/archive/blogs/davidobando/override-bitlocker-pin-entry-during-reboot</link>
      <pubDate>Thu, 29 Oct 2015 17:32:48 GMT</pubDate>
      <dc:creator><![CDATA[David Obando [MSFT]]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/davidobando/2015/10/29/override-bitlocker-pin-entry-during-reboot/</guid>
      <description><![CDATA[One of my machines has bitlocker enabed but doesn't have a TPM chip. This translates into an...]]></description>
      <content:encoded><![CDATA[<p>One of my machines has bitlocker enabed but doesn't have a TPM chip. This translates into an annoying but secure PIN or password entry every time a reboot is required. This is okay when I'm near the computer but sometimes I have to reboot while being remote.</p>
<p><span style="background-color: #ffff00;"><strong>WARNING: this might leave your computer vulnerable. You're doing this under your own risk.</strong></span></p>
<p>If you're in this situation, take a look at this article: <a title="https://gallery.technet.microsoft.com/Restart-Computer-with-707ae728" href="https://gallery.technet.microsoft.com/Restart-Computer-with-707ae728">https://gallery.technet.microsoft.com/Restart-Computer-with-707ae728</a>.</p>
<p>Copy the powershell script from there into a file called&nbsp;<strong>Restart-ComputerWithBitlocker.ps1</strong>. To run, open Powershell as an Administrator and execute:</p>
<p>PS&gt; . .\Restart-ComputerWithBitlocker.ps1;&nbsp;Restart-ComputerWithBitlocker</p>
<p>If you prefer to have a CMD file, create one and put these contents inside:</p>
<pre>@echo off<br />powershell -command "&amp; { . %~dp0\Restart-ComputerWithBitlocker.ps1; Restart-ComputerWithBitlocker }"</pre>
<p>Again, you'll have to execute as an Administrator.</p>
<p>Note that this is not supported by Microsoft. Also, note that if you chose to execute this you're clearing Microsoft and myself from any issues that might derive from it, including security-related issues. Please, always ensure you understand each and every step of what you're doing before executing any code taken from the internet.</p>]]></content:encoded>
    </item>
    <item>
      <title>Debugging startup crash of a universal app</title>
      <link>https://docs.microsoft.com/archive/blogs/davidobando/debugging-startup-crash-of-a-universal-app</link>
      <pubDate>Fri, 09 Oct 2015 14:52:00 GMT</pubDate>
      <dc:creator><![CDATA[David Obando [MSFT]]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/davidobando/2015/10/09/debugging-startup-crash-of-a-universal-app/</guid>
      <description><![CDATA[You'll need a few tools:

NP Profiler

Make sure to select the Store App version of...]]></description>
      <content:encoded><![CDATA[<p>You'll need a few tools:</p>
<ul type="disc">
<li><span>NP Profiler</span></li>
<ul type="circle">
<li><span>Make sure to select the Store App version of NP</span></li>
<li><a href="https://www.microsoft.com/en-us/download/details.aspx?id=35370"><span>https://www.microsoft.com/en-us/download/details.aspx?id=35370</span></a></li>
</ul>
<li><span>WinDbg</span></li>
<ul type="circle">
<li><span>If you have the Windows Developer Kit, you already have it</span></li>
<li><a href="https://msdn.microsoft.com/en-us/windows/hardware/hh852365"><span>https://msdn.microsoft.com/en-us/windows/hardware/hh852365</span></a></li>
</ul>
<li><span>SOSEX</span></li>
<ul type="circle">
<li><span>This is an extension to analyze managed stacks in WinDbg</span></li>
<li><a href="https://www.stevestechspot.com/"><span>https://www.stevestechspot.com/</span></a></li>
</ul>
</ul>
<p>&nbsp;</p>
<p>Start the NP profiler and select your app. Select "Run under Debugger (without the profiler)" and select WinDbg from the Profiler Options.</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/52/22/7065.NPStoreApps.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-52-22/7065.NPStoreApps.png"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/52/22/7065.NPStoreApps.png" original-url="https://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-52-22/7065.NPStoreApps.png" alt="" border="0" /></a></p>
<p>Click on <strong>Start Profiling</strong>. WinDbg will start up and immediately kick off execution of your application.</p>
<p>&nbsp;</p>
<p>Immediately, load SOSEX by executing:</p>
<p>.load [path\to\sosex\sosex]</p>
<p>&nbsp;</p>
<p>Set WinDbg to break on CLR exceptions by executing:</p>
<p>sxe clr</p>
<p>&nbsp;</p>
<p>Continue execution of your app under WinDbg until you hit the first chance exception. Once there, you can list the stack trace by executing:</p>
<p>kP</p>
<p>&nbsp;</p>
<p>Or list the managed stack trace (with access to IL) by executing:</p>
<p>!mk</p>
<p>&nbsp;</p>
<p>This should tell you where your application is crashing. The first chance exception will typically give you an address in memory of the instruction that failed, and if it's in managed code, it'll tell you the IL+number where it happened. That number is the number of IL instructions into the method where it failed. You can list the IL for the method by clicking on the IP of the function, or typing !muf [memory address]</p>
<p lang="x-none"><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/52/22/5584.mk.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-52-22/5584.mk.png"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/52/22/5584.mk.png" original-url="https://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-52-22/5584.mk.png" alt="" border="0" /></a></p>
<p>So for example, if the exception tells you that it's thrown from IL+001e you can go to the method that threw and see what is in that space:</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/52/22/6320.muf.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-52-22/6320.muf.png"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/52/22/6320.muf.png" original-url="https://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-52-22/6320.muf.png" alt="" border="0" /></a></p>
<p lang="x-none">In this example, the exception was thrown when we called Window.get_Content.</p>]]></content:encoded>
    </item>
    <item>
      <title>MVP Stream (in Spanish)</title>
      <link>https://docs.microsoft.com/archive/blogs/davidobando/mvp-stream-in-spanish</link>
      <pubDate>Tue, 26 May 2015 08:34:00 GMT</pubDate>
      <dc:creator><![CDATA[David Obando [MSFT]]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/davidobando/2015/05/26/mvp-stream-in-spanish/</guid>
      <description><![CDATA[Mat&iacute;as Quaranta, an MVP from Argentina, created this amazing tool that aggregates blog...]]></description>
      <content:encoded><![CDATA[<p>Mat&iacute;as Quaranta, an MVP from Argentina, created this amazing tool that aggregates blog content from a multitude of Spanish-speaking MVPs from Latin America and Spain.</p>
<p><a href="https://mvpstream.azurewebsites.net/">https://mvpstream.azurewebsites.net/</a></p>
<p>Highly recommended resource for Spanish-speaking developers. Make sure you follow <a href="https://twitter.com/mvpstreams">@mvpstreams</a> on twitter too!</p>]]></content:encoded>
    </item>
    <item>
      <title>Entity Framework performance whitepaper</title>
      <link>https://docs.microsoft.com/archive/blogs/davidobando/entity-framework-performance-whitepaper</link>
      <pubDate>Fri, 14 Nov 2014 16:27:28 GMT</pubDate>
      <dc:creator><![CDATA[David Obando [MSFT]]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/davidobando/2014/11/14/entity-framework-performance-whitepaper/</guid>
      <description><![CDATA[The Entity Framework team first published the EF performance considerations whitepaper for EF5 back...]]></description>
      <content:encoded><![CDATA[<p>The Entity Framework team first published the EF performance considerations whitepaper for EF5 back in April 2012. In May 2014 we updated it to cover and compare EF 4, 5 and 6. We highly encourage people to move up to the latest version of Entity Framework 6 since that's where most of our performance investment is taking place these days.</p>
<p>You can see the entire Entity Framework Performance Considerations whitepaper here:&nbsp;<a href="https://aka.ms/efperf">https://aka.ms/efperf</a></p>
<p>Please leave questions, comments, and requests for improvement in the comments. Thank you!</p>
<p>David.</p>]]></content:encoded>
    </item>
    <item>
      <title>Power BI - big data analysis in three easy steps</title>
      <link>https://docs.microsoft.com/archive/blogs/davidobando/power-bi-big-data-analysis-in-three-easy-steps</link>
      <pubDate>Thu, 11 Sep 2014 12:09:00 GMT</pubDate>
      <dc:creator><![CDATA[David Obando [MSFT]]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/davidobando/2014/09/11/power-bi-big-data-analysis-in-three-easy-steps/</guid>
      <description><![CDATA[Pedro Ardila from Microsoft writes about obtaining actionable insights out of your big data in three...]]></description>
      <content:encoded><![CDATA[<p>Pedro Ardila from Microsoft writes about obtaining actionable insights out of your big data in <a href="https://blogs.msdn.com/b/powerbi/archive/2014/09/10/three-steps-to-gleaning-actionable-insights-using-power-bi.aspx">three easy steps using Power BI</a>.</p>
<p>Enjoy!</p>]]></content:encoded>
    </item>
    <item>
      <title>Quick tip for concurrency when using Entity Framework</title>
      <link>https://docs.microsoft.com/archive/blogs/davidobando/quick-tip-for-concurrency-when-using-entity-framework</link>
      <pubDate>Wed, 27 Aug 2014 18:56:00 GMT</pubDate>
      <dc:creator><![CDATA[David Obando [MSFT]]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/davidobando/2014/08/27/quick-tip-for-concurrency-when-using-entity-framework/</guid>
      <description><![CDATA[Entity Framework does a great job at simplifying the way we interact with storage. Sometimes we need...]]></description>
      <content:encoded><![CDATA[<p class="MsoNormal" style="mso-margin-top-alt: auto; mso-margin-bottom-alt: auto; line-height: normal;"><span style="font-size: 9.0pt; font-family: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'; color: black;">Entity Framework does a great job at simplifying the way we interact with storage. Sometimes we need to use parallelism to speed up the completion of a task. This is usually done by means of multithreading (note: <em>always prefer to use a new context per request, instead of a context per thread</em>) or with&nbsp;<span class="SpellE">async</span>. In both cases we are attempting to scale our application, and in both cases Entity Framework has been tuned to scale linearly. However, some users might experience resource contention that limits the parallelism they are expecting when the Garbage Collector is not properly configured.</span></p>
<p class="MsoNormal" style="mso-margin-top-alt: auto; mso-margin-bottom-alt: auto; line-height: normal;"><span style="font-size: 9.0pt; font-family: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'; color: black;">Whenever EF is used in a multithreaded scenario, or in any application that resembles a server system, make sure to enable server garbage collection. This is done via a simple setting in your application <span class="SpellE">config</span> file:</span></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: 125%; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt; background: white;"><span class="GramE"><span style="font-size: 10.0pt; line-height: 125%; font-family: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; color: blue;">&lt;?</span><span style="font-size: 10.0pt; line-height: 125%; font-family: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; color: #a31515;">xml</span></span><span style="font-size: 10.0pt; line-height: 125%; font-family: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; color: red;">version</span><span style="font-size: 10.0pt; line-height: 125%; font-family: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; color: blue;">=</span><span style="font-size: 10.0pt; line-height: 125%; font-family: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; color: black;">"</span><span style="font-size: 10.0pt; line-height: 125%; font-family: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; color: blue;">1.0</span><span style="font-size: 10.0pt; line-height: 125%; font-family: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; color: black;">" </span><span style="font-size: 10.0pt; line-height: 125%; font-family: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; color: red;">encoding</span><span style="font-size: 10.0pt; line-height: 125%; font-family: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; color: blue;">=</span><span style="font-size: 10.0pt; line-height: 125%; font-family: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; color: black;">"</span><span style="font-size: 10.0pt; line-height: 125%; font-family: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; color: blue;">utf-8</span><span style="font-size: 10.0pt; line-height: 125%; font-family: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; color: black;">" </span><span style="font-size: 10.0pt; line-height: 125%; font-family: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; color: blue;">?&gt;</span></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: 125%; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt; background: white;"><span style="font-size: 10.0pt; line-height: 125%; font-family: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; color: blue;">&lt;</span><span class="GramE"><span style="font-size: 10.0pt; line-height: 125%; font-family: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; color: #a31515;">configuration</span></span><span style="font-size: 10.0pt; line-height: 125%; font-family: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; color: blue;">&gt;</span></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: 125%; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt; background: white;"><span style="font-size: 10.0pt; line-height: 125%; font-family: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; color: black;"><span style="mso-tab-count: 1;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span><span style="font-size: 10.0pt; line-height: 125%; font-family: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; color: blue;">&lt;</span><span class="GramE"><span style="font-size: 10.0pt; line-height: 125%; font-family: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; color: #a31515;">runtime</span></span><span style="font-size: 10.0pt; line-height: 125%; font-family: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; color: blue;">&gt;</span></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: 125%; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt; background: white;"><span style="font-size: 10.0pt; line-height: 125%; font-family: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; color: black;"><span style="mso-tab-count: 2;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span><span style="font-size: 10.0pt; line-height: 125%; font-family: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; color: blue;">&lt;</span><span class="SpellE"><span style="font-size: 10.0pt; line-height: 125%; font-family: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; color: #a31515;">gcServer&nbsp;</span></span><span style="font-size: 10.0pt; line-height: 125%; font-family: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; color: red;">enabled</span><span style="font-size: 10.0pt; line-height: 125%; font-family: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; color: blue;">=</span><span style="font-size: 10.0pt; line-height: 125%; font-family: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; color: black;">"</span><span style="font-size: 10.0pt; line-height: 125%; font-family: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; color: blue;">true</span><span style="font-size: 10.0pt; line-height: 125%; font-family: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; color: black;">" </span><span style="font-size: 10.0pt; line-height: 125%; font-family: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; color: blue;">/&gt;</span></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: 125%; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt; background: white;"><span style="font-size: 10.0pt; line-height: 125%; font-family: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; color: black;"><span style="mso-tab-count: 1;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span><span style="font-size: 10.0pt; line-height: 125%; font-family: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; color: blue;">&lt;/</span><span style="font-size: 10.0pt; line-height: 125%; font-family: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; color: #a31515;">runtime</span><span style="font-size: 10.0pt; line-height: 125%; font-family: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; color: blue;">&gt;</span></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: 125%; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt; background: white;"><span style="font-size: 10.0pt; line-height: 125%; font-family: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; color: blue;">&lt;/</span><span style="font-size: 10.0pt; line-height: 125%; font-family: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; color: #a31515;">configuration</span><span style="font-size: 10.0pt; line-height: 125%; font-family: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; color: blue;">&gt;</span></p>
<p class="MsoNormal" style="mso-margin-top-alt: auto; mso-margin-bottom-alt: auto; line-height: normal;"><span style="font-size: 9.0pt; font-family: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'; color: black;">This should decrease your thread contention and increase your throughput by up to 30% in CPU saturated scenarios.</span></p>
<p class="MsoNormal">&nbsp;</p>]]></content:encoded>
    </item>
    <item>
      <title>Quick tip for large applications using Entity Framework Code-First</title>
      <link>https://docs.microsoft.com/archive/blogs/davidobando/quick-tip-for-large-applications-using-entity-framework-code-first</link>
      <pubDate>Fri, 15 Aug 2014 11:39:51 GMT</pubDate>
      <dc:creator><![CDATA[David Obando [MSFT]]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/davidobando/2014/08/15/quick-tip-for-large-applications-using-entity-framework-code-first/</guid>
      <description><![CDATA[Quick tip. When using Entity Framework and its Code-First way of working your code to configure the...]]></description>
      <content:encoded><![CDATA[<p>Quick tip. When using Entity Framework and its Code-First way of working your code to configure the entities might grow very large. When that's the case, it might be possible to see under a profiler that the JIT'er is taking a large amount of time just to get you started. There are two ways to go about this:</p>
<p>1) The good and hard way: refactor your code to be more compact and simplified. This will help the JIT'er produce code faster and possibly better optimized.</p>
<p>2) The easy way: NGEN your application and its dependencies.</p>
<p>NGEN will compile your assembly and load it with zero JIT cost. This proves to be tremendously useful in cold-startup scenarios.</p>]]></content:encoded>
    </item>
    <item>
      <title>How to get the EDMX metadata from a Code First model (and why you need it)</title>
      <link>https://docs.microsoft.com/archive/blogs/davidobando/how-to-get-the-edmx-metadata-from-a-code-first-model-and-why-you-need-it</link>
      <pubDate>Wed, 30 Jul 2014 12:02:00 GMT</pubDate>
      <dc:creator><![CDATA[David Obando [MSFT]]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/davidobando/2014/07/30/how-to-get-the-edmx-metadata-from-a-code-first-model-and-why-you-need-it/</guid>
      <description><![CDATA[Entity Framework provides a very good experience with its Code First development model. In it you...]]></description>
      <content:encoded><![CDATA[<p><span style="font-size: 9.0pt; font-family: 'Arial','sans-serif'; color: black;">Entity Framework provides a very good experience with its Code First development model. In it you can define classes and use them as POCO entities (Plain Old CLR Objects). For example, consider the following model:</span></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none; orphans: auto; text-align: start; widows: auto; -webkit-text-stroke-width: 0px; word-spacing: 0px;"><span style="font-size: 9.0pt; font-family: 'Arial','sans-serif'; color: black;">&nbsp;</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white; mso-highlight: white;"><span style="mso-spacerun: yes;">&nbsp;&nbsp;&nbsp; </span></span><span class="GramE"><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white; mso-highlight: white;">public</span></span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white; mso-highlight: white;"> class</span><span style="font-size: 9.5pt; font-family: Consolas; color: #2b91af; background: white; mso-highlight: white;"> Blog</span></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white; mso-highlight: white;"><span style="mso-spacerun: yes;">&nbsp;&nbsp;&nbsp; </span>{</span></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white; mso-highlight: white;"><span style="mso-spacerun: yes;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span><span class="GramE"><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white; mso-highlight: white;">public</span></span><span class="SpellE"><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white; mso-highlight: white;"> int</span></span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white; mso-highlight: white;"> <span class="SpellE">BlogId</span> { </span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white; mso-highlight: white;">get</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white; mso-highlight: white;">; </span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white; mso-highlight: white;">set</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white; mso-highlight: white;">; }</span></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white; mso-highlight: white;"><span style="mso-spacerun: yes;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span><span class="GramE"><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white; mso-highlight: white;">public</span></span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white; mso-highlight: white;"> string</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white; mso-highlight: white;"> Name { </span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white; mso-highlight: white;">get</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white; mso-highlight: white;">; </span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white; mso-highlight: white;">set</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white; mso-highlight: white;">; }</span></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white; mso-highlight: white;"><span style="mso-spacerun: yes;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span><span class="GramE"><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white; mso-highlight: white;">public</span></span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white; mso-highlight: white;"> virtual</span><span class="SpellE"><span style="font-size: 9.5pt; font-family: Consolas; color: #2b91af; background: white; mso-highlight: white;"> ICollection</span></span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white; mso-highlight: white;">&lt;</span><span style="font-size: 9.5pt; font-family: Consolas; color: #2b91af; background: white; mso-highlight: white;">Post</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white; mso-highlight: white;">&gt; Posts { </span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white; mso-highlight: white;">get</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white; mso-highlight: white;">; </span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white; mso-highlight: white;">set</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white; mso-highlight: white;">; }</span></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white; mso-highlight: white;"><span style="mso-spacerun: yes;">&nbsp;&nbsp;&nbsp; </span>}</span></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white; mso-highlight: white;">&nbsp;</span></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white; mso-highlight: white;"><span style="mso-spacerun: yes;">&nbsp;&nbsp;&nbsp; </span></span><span class="GramE"><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white; mso-highlight: white;">public</span></span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white; mso-highlight: white;"> class</span><span style="font-size: 9.5pt; font-family: Consolas; color: #2b91af; background: white; mso-highlight: white;"> Post</span></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white; mso-highlight: white;"><span style="mso-spacerun: yes;">&nbsp;&nbsp;&nbsp; </span>{</span></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white; mso-highlight: white;"><span style="mso-spacerun: yes;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span><span class="GramE"><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white; mso-highlight: white;">public</span></span><span class="SpellE"><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white; mso-highlight: white;"> int</span></span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white; mso-highlight: white;"> <span class="SpellE">PostId</span> { </span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white; mso-highlight: white;">get</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white; mso-highlight: white;">; </span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white; mso-highlight: white;">set</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white; mso-highlight: white;">; }</span></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white; mso-highlight: white;"><span style="mso-spacerun: yes;">&nbsp;</span><span style="mso-spacerun: yes;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>[</span><span class="SpellE"><span class="GramE"><span style="font-size: 9.5pt; font-family: Consolas; color: #2b91af; background: white; mso-highlight: white;">MaxLength</span></span></span><span class="GramE"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white; mso-highlight: white;">(</span></span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white; mso-highlight: white;">200)]</span></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white; mso-highlight: white;"><span style="mso-spacerun: yes;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span><span class="GramE"><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white; mso-highlight: white;">public</span></span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white; mso-highlight: white;"> string</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white; mso-highlight: white;"> Title { </span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white; mso-highlight: white;">get</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white; mso-highlight: white;">; </span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white; mso-highlight: white;">set</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white; mso-highlight: white;">; }</span></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white; mso-highlight: white;"><span style="mso-spacerun: yes;">&nbsp;</span><span style="mso-spacerun: yes;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span><span class="GramE"><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white; mso-highlight: white;">public</span></span><span class="SpellE"><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white; mso-highlight: white;"> int</span></span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white; mso-highlight: white;"> <span class="SpellE">LikeCount</span> { </span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white; mso-highlight: white;">get</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white; mso-highlight: white;">; </span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white; mso-highlight: white;">set</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white; mso-highlight: white;">; }</span></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white; mso-highlight: white;"><span style="mso-spacerun: yes;">&nbsp;</span><span style="mso-spacerun: yes;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span><span class="GramE"><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white; mso-highlight: white;">public</span></span><span class="SpellE"><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white; mso-highlight: white;"> int</span></span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white; mso-highlight: white;"> <span class="SpellE">BlogId</span> { </span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white; mso-highlight: white;">get</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white; mso-highlight: white;">; </span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white; mso-highlight: white;">set</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white; mso-highlight: white;">; }</span></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white; mso-highlight: white;"><span style="mso-spacerun: yes;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span><span class="GramE"><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white; mso-highlight: white;">public</span></span><span style="font-size: 9.5pt; font-family: Consolas; color: #2b91af; background: white; mso-highlight: white;"> Blog</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white; mso-highlight: white;"> <span class="SpellE">Blog</span> { </span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white; mso-highlight: white;">get</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white; mso-highlight: white;">; </span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white; mso-highlight: white;">set</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white; mso-highlight: white;">; }</span></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white; mso-highlight: white;"><span style="mso-spacerun: yes;">&nbsp;&nbsp;&nbsp; </span>}</span></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white; mso-highlight: white;">&nbsp;</span></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white; mso-highlight: white;"><span style="mso-spacerun: yes;">&nbsp;&nbsp;&nbsp; </span></span><span class="GramE"><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white; mso-highlight: white;">public</span></span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white; mso-highlight: white;"> class</span><span class="SpellE"><span style="font-size: 9.5pt; font-family: Consolas; color: #2b91af; background: white; mso-highlight: white;"> BlogContext</span></span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white; mso-highlight: white;"> : </span><span style="font-size: 9.5pt; font-family: Consolas; color: #2b91af; background: white; mso-highlight: white;">DbContext</span></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white; mso-highlight: white;"><span style="mso-spacerun: yes;">&nbsp;&nbsp;&nbsp; </span>{</span></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white; mso-highlight: white;"><span style="mso-spacerun: yes;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span><span class="GramE"><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white; mso-highlight: white;">public</span></span><span style="font-size: 9.5pt; font-family: Consolas; color: #2b91af; background: white; mso-highlight: white;"> DbSet</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white; mso-highlight: white;">&lt;</span><span style="font-size: 9.5pt; font-family: Consolas; color: #2b91af; background: white; mso-highlight: white;">Blog</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white; mso-highlight: white;">&gt; Blogs { </span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white; mso-highlight: white;">get</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white; mso-highlight: white;">; </span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white; mso-highlight: white;">set</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white; mso-highlight: white;">; }</span></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white; mso-highlight: white;"><span style="mso-spacerun: yes;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span><span class="GramE"><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white; mso-highlight: white;">public</span></span><span style="font-size: 9.5pt; font-family: Consolas; color: #2b91af; background: white; mso-highlight: white;"> DbSet</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white; mso-highlight: white;">&lt;</span><span style="font-size: 9.5pt; font-family: Consolas; color: #2b91af; background: white; mso-highlight: white;">Post</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white; mso-highlight: white;">&gt; Posts { </span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white; mso-highlight: white;">get</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white; mso-highlight: white;">; </span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white; mso-highlight: white;">set</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white; mso-highlight: white;">; }</span></p>
<p><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white; mso-highlight: white;"><span style="mso-spacerun: yes;">&nbsp;&nbsp;&nbsp; </span>}</span></p>
<p style="orphans: auto; text-align: start; widows: auto; -webkit-text-stroke-width: 0px; word-spacing: 0px;"><span style="font-size: 9.0pt; font-family: 'Arial','sans-serif'; color: black;">&nbsp;In terms of usability it's a great way to go since the code is self-explanatory and can be highly customized via the <a href="https://msdn.microsoft.com/en-us/data/JJ591617.aspx">Fluent API</a>. Now, you might be asking yourself: what happened with the EDMX file? Well, you don&rsquo;t really see it but it still exists.</span></p>
<p><span style="font-size: 9.0pt; font-family: 'Arial','sans-serif'; color: black;">The way Entity Framework Code First works is by analyzing your assemblies for all the types related to your model and enumerating into a set of &ldquo;discovered types&rdquo;. Once EF knows about these types, it explores them looking for special attributes such as [Key], [<span class="SpellE">MaxLength</span>] and [Index] to know more about the model. Finally, it applies a set of conventions that allow it to discover information that&rsquo;s not explicitly set. One such convention is the discovery of keys by which field <span class="SpellE"><em style="mso-bidi-font-style: normal;">PostId</em></span> is discovered as the key to the <em style="mso-bidi-font-style: normal;">Post</em> entity. There&rsquo;s a number of <a href="https://msdn.microsoft.com/en-us/data/jj679962.aspx">these conventions</a> and it&rsquo;s important that you understand them before using Code First.</span></p>
<p><span style="font-size: 9.0pt; font-family: 'Arial','sans-serif'; color: black;">The resulting fully-loaded model description is stored in memory using the EDM format. Effectively, Code First reverse-engineers an EDMX out of the POCOs, attributes and fluent API calls. From here on, Entity Framework doesn&rsquo;t care whether you created the model Code First or Model First, it behaves the same. It goes on and generates the views, validates the model and sets up all the metadata to be ready to serve its purpose.</span></p>
<p><span style="font-size: 9.0pt; font-family: 'Arial','sans-serif'; color: black;">As you might imagine the process of reverse engineering the EDMX out of the Code First model is costly. It&rsquo;s only paid for once on the startup of your first context, but it may represent a performance annoyance for your application. There&rsquo;s a way to speed your start up though: use an EDMX in your project.</span></p>
<p><span style="font-size: 9.0pt; font-family: 'Arial','sans-serif'; color: black;">For this, you&rsquo;ll want to obtain the EDMX data from your Code First context by calling:</span></p>
<p><span class="SpellE"><span class="GramE"><span style="font-size: 9.5pt; font-family: Consolas; color: #2b91af; background: white; mso-highlight: white;">EdmxWriter</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white; mso-highlight: white;">.WriteEdmx</span></span></span><span class="GramE"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white; mso-highlight: white;">(</span></span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white; mso-highlight: white;">context, </span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white; mso-highlight: white;">new</span><span class="SpellE"><span style="font-size: 9.5pt; font-family: Consolas; color: #2b91af; background: white; mso-highlight: white;"> XmlTextWriter</span></span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white; mso-highlight: white;">(</span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white; mso-highlight: white;">new</span><span class="SpellE"><span style="font-size: 9.5pt; font-family: Consolas; color: #2b91af; background: white; mso-highlight: white;"> StreamWriter</span></span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white; mso-highlight: white;">(</span><span style="font-size: 9.5pt; font-family: Consolas; color: #a31515; background: white; mso-highlight: white;">"<span class="SpellE">MyModel.edmx</span>"</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white; mso-highlight: white;">)));</span></p>
<p><span style="font-size: 9.0pt; font-family: 'Arial','sans-serif'; color: black;">Call it in your context instance and you&rsquo;ll get an EDMX file with all the data you require. Add the EDMX to your project and <a href="https://msdn.microsoft.com/en-us/library/vstudio/cc716756(v=vs.110).aspx">modify your connection string</a> accordingly to make use of the EDMX data.</span></p>
<p><span style="font-size: 9.0pt; font-family: 'Arial','sans-serif'; color: black;">Large models will benefit the most. I&rsquo;ve noticed reductions in the hundreds of milliseconds just for the EDMX generation part of the code.</span></p>]]></content:encoded>
    </item>
    <item>
      <title>Wrapping IQueryable objects for testability</title>
      <link>https://docs.microsoft.com/archive/blogs/davidobando/wrapping-iqueryable-objects-for-testability</link>
      <pubDate>Wed, 11 Jun 2014 14:46:00 GMT</pubDate>
      <dc:creator><![CDATA[David Obando [MSFT]]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/davidobando/2014/06/11/wrapping-iqueryable-objects-for-testability/</guid>
      <description><![CDATA[In some cases, testing IQueryable objects can be difficult. They are hard to mock and the LINQ magic...]]></description>
      <content:encoded><![CDATA[<p>In some cases, testing IQueryable objects can be difficult. They are hard to mock and the LINQ magic that's happening under the hood is usually hidden from&nbsp;the programmer. It would be&nbsp;convenient to wrap an IQueryable around a mockable container so that our code can be tested even when the actual data sources may not be present.</p>
<p>To this effect, I've found that it's very easy to wrap an IQueryable around a LINQ provider that simply defers execution of the queries to the instance it wraps. The instance can then be mocked in our tests and we can continue development without this dependency. Such a wrapper provider looks much like this code.</p>
<p>Code:</p>
<pre>    public class WrapperProvider : IQueryProvider
    {
        private readonly IQueryable _query;

        public WrapperProvider(IQueryable query)
        {
            _query = query;
        }

        public IQueryable&lt;TElement&gt; CreateQuery&lt;TElement&gt;(Expression expression)
        {
            return new WrapperContext&lt;TElement&gt;(this, expression);
        }

        public IQueryable CreateQuery(Expression expression)
        {
            return new WrapperContext(this, expression);
        }

        public TResult Execute&lt;TResult&gt;(Expression expression)
        {
            var newExpression = new ExpressionTreeModifier(_query).Accept(expression);

            if ((typeof(TResult).Name.StartsWith("IEnumerable")))
            {
                return (TResult)_query.Provider.CreateQuery(newExpression);
            }
            
            return (TResult)_query.Provider.Execute(newExpression);
        }

        public object Execute(Expression expression)
        {
            var newExpression = new ExpressionTreeModifier(_query).Accept(expression);
            return _query.Provider.Execute(newExpression);
        }
    }

    internal class ExpressionTreeModifier : ExpressionVisitor
    {
        private readonly IQueryable _query;

        internal ExpressionTreeModifier(IQueryable query)
        {
            _query = query;
        }

        protected override Expression VisitConstant(ConstantExpression c)
        {
            var wrapperType = typeof (WrapperContext);
            for (var iteratorType = c.Type; iteratorType != null; iteratorType = iteratorType.BaseType)
            {
                if (iteratorType == wrapperType)
                {
                    return Expression.Constant(_query);
                }
            }
            return c;
        }

        internal Expression Accept(Expression expression)
        {
            return Visit(expression);
        }
    }

    public class WrapperContext : IQueryable
    {
        public WrapperContext(IQueryable query)
        {
            Expression = Expression.Constant(this);
            Provider = new WrapperProvider(query);
        }

        internal WrapperContext(IQueryProvider provider, Expression expression)
        {
            Expression = expression;
            Provider = provider;
        }

        public IEnumerator GetEnumerator()
        {
            return Provider.Execute&lt;IEnumerable&gt;(Expression).GetEnumerator();
        }

        public Expression Expression { get; private set; }
        public Type ElementType { get; private set; }
        public IQueryProvider Provider { get; private set; }
    }

    public class WrapperContext&lt;T&gt; : WrapperContext, IQueryable&lt;T&gt;
    {
        public WrapperContext(IQueryable&lt;T&gt; query)
            : base(query)
        {
        }

        internal WrapperContext(IQueryProvider provider, Expression expression)
            : base(provider, expression)
        {
        }

        public new IEnumerator&lt;T&gt; GetEnumerator()
        {
            return Provider.Execute&lt;IEnumerable&lt;T&gt;&gt;(Expression).GetEnumerator();
        }
    }

</pre>
<p>In our actual code we may choose to do things like Assert.Equals(new WrapperContext&lt;Customer&gt;(context.Customers).Where(c =&gt; c.CustomerID == 1).Count(), 1), knowing that the execution will be deferred to whatever implementation of IQueryable the wrapper contains.</p>
<p>David.</p>]]></content:encoded>
    </item>
    <item>
      <title>Changing EF's default connection factory from LocalDb to Sql Server</title>
      <link>https://docs.microsoft.com/archive/blogs/davidobando/changing-efs-default-connection-factory-from-localdb-to-sql-server</link>
      <pubDate>Tue, 14 Aug 2012 15:03:00 GMT</pubDate>
      <dc:creator><![CDATA[David Obando [MSFT]]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/davidobando/2012/08/14/changing-efs-default-connection-factory-from-localdb-to-sql-server/</guid>
      <description><![CDATA[When you create a new project that makes use of Entity Framework 5, you'll notice how it uses...]]></description>
      <content:encoded><![CDATA[<p>When you create a new project that makes use of Entity Framework 5, you'll notice how it uses LocalDb by default now. But let's assume you have a fully working instance of Sql Server that you wish to work against instead of LocalDb. How do you tell EF to use it? Simple, modify your application's config file. If you are running a web service or a website, your config file is web.config. If you are running a console application or a windows application, look for app.config.</p>
<p><strong>LocalDb</strong></p>
<p>&nbsp; <span style="color: #0000ff; font-family: Consolas; font-size: x-small;" face="Consolas" color="#0000ff" size="2"><span style="color: #0000ff; font-family: Consolas; font-size: x-small;" face="Consolas" color="#0000ff" size="2"><span style="color: #0000ff; font-family: Consolas; font-size: x-small;" face="Consolas" color="#0000ff" size="2">&lt;<span style="color: #a31515; font-family: Consolas; font-size: x-small;" face="Consolas" color="#a31515" size="2"><span style="color: #a31515; font-family: Consolas; font-size: x-small;" face="Consolas" color="#a31515" size="2"><span style="color: #a31515; font-family: Consolas; font-size: x-small;" face="Consolas" color="#a31515" size="2">entityFramework</span></span></span><span style="color: #0000ff; font-family: Consolas; font-size: x-small;" face="Consolas" color="#0000ff" size="2"><span style="color: #0000ff; font-family: Consolas; font-size: x-small;" face="Consolas" color="#0000ff" size="2"><span style="color: #0000ff; font-family: Consolas; font-size: x-small;" face="Consolas" color="#0000ff" size="2">&gt;</span></span></span></span></span></span></p>
<p>&nbsp;&nbsp;&nbsp; <span style="color: #0000ff; font-family: Consolas; font-size: x-small;" face="Consolas" color="#0000ff" size="2"><span style="color: #0000ff; font-family: Consolas; font-size: x-small;" face="Consolas" color="#0000ff" size="2"><span style="color: #0000ff; font-family: Consolas; font-size: x-small;" face="Consolas" color="#0000ff" size="2">&lt;<span style="color: #a31515; font-family: Consolas; font-size: x-small;" face="Consolas" color="#a31515" size="2"><span style="color: #a31515; font-family: Consolas; font-size: x-small;" face="Consolas" color="#a31515" size="2"><span style="color: #a31515; font-family: Consolas; font-size: x-small;" face="Consolas" color="#a31515" size="2">defaultConnectionFactory</span></span></span><span style="color: #0000ff; font-family: Consolas; font-size: x-small;" face="Consolas" color="#0000ff" size="2"><span style="color: #0000ff; font-family: Consolas; font-size: x-small;" face="Consolas" color="#0000ff" size="2"><span style="color: #0000ff; font-family: Consolas; font-size: x-small;" face="Consolas" color="#0000ff" size="2"> </span></span></span><span style="color: #ff0000; font-family: Consolas; font-size: x-small;" face="Consolas" color="#ff0000" size="2"><span style="color: #ff0000; font-family: Consolas; font-size: x-small;" face="Consolas" color="#ff0000" size="2"><span style="color: #ff0000; font-family: Consolas; font-size: x-small;" face="Consolas" color="#ff0000" size="2">type</span></span></span><span style="color: #0000ff; font-family: Consolas; font-size: x-small;" face="Consolas" color="#0000ff" size="2"><span style="color: #0000ff; font-family: Consolas; font-size: x-small;" face="Consolas" color="#0000ff" size="2"><span style="color: #0000ff; font-family: Consolas; font-size: x-small;" face="Consolas" color="#0000ff" size="2">=</span></span></span><span style="font-family: Consolas; font-size: x-small;" face="Consolas" size="2"><span style="font-family: Consolas; font-size: x-small;" face="Consolas" size="2">"</span></span><span style="color: #0000ff; font-family: Consolas; font-size: x-small;" face="Consolas" color="#0000ff" size="2"><span style="color: #0000ff; font-family: Consolas; font-size: x-small;" face="Consolas" color="#0000ff" size="2"><span style="color: #0000ff; font-family: Consolas; font-size: x-small;" face="Consolas" color="#0000ff" size="2">System.Data.Entity.Infrastructure.LocalDbConnectionFactory, EntityFramework</span></span></span><span style="font-family: Consolas; font-size: x-small;" face="Consolas" size="2"><span style="font-family: Consolas; font-size: x-small;" face="Consolas" size="2">"</span></span><span style="color: #0000ff; font-family: Consolas; font-size: x-small;" face="Consolas" color="#0000ff" size="2"><span style="color: #0000ff; font-family: Consolas; font-size: x-small;" face="Consolas" color="#0000ff" size="2"><span style="color: #0000ff; font-family: Consolas; font-size: x-small;" face="Consolas" color="#0000ff" size="2">&gt;</span></span></span></span></span></span></p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: #0000ff; font-family: Consolas; font-size: x-small;" face="Consolas" color="#0000ff" size="2"><span style="color: #0000ff; font-family: Consolas; font-size: x-small;" face="Consolas" color="#0000ff" size="2"><span style="color: #0000ff; font-family: Consolas; font-size: x-small;" face="Consolas" color="#0000ff" size="2">&lt;<span style="color: #a31515; font-family: Consolas; font-size: x-small;" face="Consolas" color="#a31515" size="2"><span style="color: #a31515; font-family: Consolas; font-size: x-small;" face="Consolas" color="#a31515" size="2"><span style="color: #a31515; font-family: Consolas; font-size: x-small;" face="Consolas" color="#a31515" size="2">parameters</span></span></span><span style="color: #0000ff; font-family: Consolas; font-size: x-small;" face="Consolas" color="#0000ff" size="2"><span style="color: #0000ff; font-family: Consolas; font-size: x-small;" face="Consolas" color="#0000ff" size="2"><span style="color: #0000ff; font-family: Consolas; font-size: x-small;" face="Consolas" color="#0000ff" size="2">&gt;</span></span></span></span></span></span></p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: #0000ff; font-family: Consolas; font-size: x-small;" face="Consolas" color="#0000ff" size="2"><span style="color: #0000ff; font-family: Consolas; font-size: x-small;" face="Consolas" color="#0000ff" size="2"><span style="color: #0000ff; font-family: Consolas; font-size: x-small;" face="Consolas" color="#0000ff" size="2">&lt;<span style="color: #a31515; font-family: Consolas; font-size: x-small;" face="Consolas" color="#a31515" size="2"><span style="color: #a31515; font-family: Consolas; font-size: x-small;" face="Consolas" color="#a31515" size="2"><span style="color: #a31515; font-family: Consolas; font-size: x-small;" face="Consolas" color="#a31515" size="2">parameter</span></span></span><span style="color: #0000ff; font-family: Consolas; font-size: x-small;" face="Consolas" color="#0000ff" size="2"><span style="color: #0000ff; font-family: Consolas; font-size: x-small;" face="Consolas" color="#0000ff" size="2"><span style="color: #0000ff; font-family: Consolas; font-size: x-small;" face="Consolas" color="#0000ff" size="2"> </span></span></span><span style="color: #ff0000; font-family: Consolas; font-size: x-small;" face="Consolas" color="#ff0000" size="2"><span style="color: #ff0000; font-family: Consolas; font-size: x-small;" face="Consolas" color="#ff0000" size="2"><span style="color: #ff0000; font-family: Consolas; font-size: x-small;" face="Consolas" color="#ff0000" size="2">value</span></span></span><span style="color: #0000ff; font-family: Consolas; font-size: x-small;" face="Consolas" color="#0000ff" size="2"><span style="color: #0000ff; font-family: Consolas; font-size: x-small;" face="Consolas" color="#0000ff" size="2"><span style="color: #0000ff; font-family: Consolas; font-size: x-small;" face="Consolas" color="#0000ff" size="2">=</span></span></span><span style="font-family: Consolas; font-size: x-small;" face="Consolas" size="2"><span style="font-family: Consolas; font-size: x-small;" face="Consolas" size="2">"</span></span><span style="color: #0000ff; font-family: Consolas; font-size: x-small;" face="Consolas" color="#0000ff" size="2"><span style="color: #0000ff; font-family: Consolas; font-size: x-small;" face="Consolas" color="#0000ff" size="2"><span style="color: #0000ff; font-family: Consolas; font-size: x-small;" face="Consolas" color="#0000ff" size="2">v11.0</span></span></span><span style="font-family: Consolas; font-size: x-small;" face="Consolas" size="2"><span style="font-family: Consolas; font-size: x-small;" face="Consolas" size="2">"</span></span><span style="color: #0000ff; font-family: Consolas; font-size: x-small;" face="Consolas" color="#0000ff" size="2"><span style="color: #0000ff; font-family: Consolas; font-size: x-small;" face="Consolas" color="#0000ff" size="2"><span style="color: #0000ff; font-family: Consolas; font-size: x-small;" face="Consolas" color="#0000ff" size="2"> /&gt;</span></span></span></span></span></span></p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: #0000ff; font-family: Consolas; font-size: x-small;" face="Consolas" color="#0000ff" size="2"><span style="color: #0000ff; font-family: Consolas; font-size: x-small;" face="Consolas" color="#0000ff" size="2"><span style="color: #0000ff; font-family: Consolas; font-size: x-small;" face="Consolas" color="#0000ff" size="2">&lt;/<span style="color: #a31515; font-family: Consolas; font-size: x-small;" face="Consolas" color="#a31515" size="2"><span style="color: #a31515; font-family: Consolas; font-size: x-small;" face="Consolas" color="#a31515" size="2"><span style="color: #a31515; font-family: Consolas; font-size: x-small;" face="Consolas" color="#a31515" size="2">parameters</span></span></span><span style="color: #0000ff; font-family: Consolas; font-size: x-small;" face="Consolas" color="#0000ff" size="2"><span style="color: #0000ff; font-family: Consolas; font-size: x-small;" face="Consolas" color="#0000ff" size="2"><span style="color: #0000ff; font-family: Consolas; font-size: x-small;" face="Consolas" color="#0000ff" size="2">&gt;</span></span></span></span></span></span></p>
<p>&nbsp;&nbsp;&nbsp; <span style="color: #0000ff; font-family: Consolas; font-size: x-small;" face="Consolas" color="#0000ff" size="2"><span style="color: #0000ff; font-family: Consolas; font-size: x-small;" face="Consolas" color="#0000ff" size="2"><span style="color: #0000ff; font-family: Consolas; font-size: x-small;" face="Consolas" color="#0000ff" size="2">&lt;/<span style="color: #a31515; font-family: Consolas; font-size: x-small;" face="Consolas" color="#a31515" size="2"><span style="color: #a31515; font-family: Consolas; font-size: x-small;" face="Consolas" color="#a31515" size="2"><span style="color: #a31515; font-family: Consolas; font-size: x-small;" face="Consolas" color="#a31515" size="2">defaultConnectionFactory</span></span></span><span style="color: #0000ff; font-family: Consolas; font-size: x-small;" face="Consolas" color="#0000ff" size="2"><span style="color: #0000ff; font-family: Consolas; font-size: x-small;" face="Consolas" color="#0000ff" size="2"><span style="color: #0000ff; font-family: Consolas; font-size: x-small;" face="Consolas" color="#0000ff" size="2">&gt;</span></span></span></span></span></span></p>
<p>&nbsp; <span style="color: #0000ff; font-family: Consolas; font-size: x-small;" face="Consolas" color="#0000ff" size="2"><span style="color: #0000ff; font-family: Consolas; font-size: x-small;" face="Consolas" color="#0000ff" size="2"><span style="color: #0000ff; font-family: Consolas; font-size: x-small;" face="Consolas" color="#0000ff" size="2">&lt;/<span style="color: #a31515; font-family: Consolas; font-size: x-small;" face="Consolas" color="#a31515" size="2"><span style="color: #a31515; font-family: Consolas; font-size: x-small;" face="Consolas" color="#a31515" size="2"><span style="color: #a31515; font-family: Consolas; font-size: x-small;" face="Consolas" color="#a31515" size="2">entityFramework</span></span></span><span style="color: #0000ff; font-family: Consolas; font-size: x-small;" face="Consolas" color="#0000ff" size="2"><span style="color: #0000ff; font-family: Consolas; font-size: x-small;" face="Consolas" color="#0000ff" size="2"><span style="color: #0000ff; font-family: Consolas; font-size: x-small;" face="Consolas" color="#0000ff" size="2">&gt;</span></span></span></span></span></span></p>
<p>Now, replace that portion of the configuration to make use of Sql Server instead of LocalDb.</p>
<p><strong>Sql Server</strong></p>
<p>&nbsp; <span style="color: #0000ff; font-family: Consolas; font-size: x-small;" face="Consolas" color="#0000ff" size="2"><span style="color: #0000ff; font-family: Consolas; font-size: x-small;" face="Consolas" color="#0000ff" size="2"><span style="color: #0000ff; font-family: Consolas; font-size: x-small;" face="Consolas" color="#0000ff" size="2">&lt;<span style="color: #a31515; font-family: Consolas; font-size: x-small;" face="Consolas" color="#a31515" size="2"><span style="color: #a31515; font-family: Consolas; font-size: x-small;" face="Consolas" color="#a31515" size="2"><span style="color: #a31515; font-family: Consolas; font-size: x-small;" face="Consolas" color="#a31515" size="2">entityFramework</span></span></span><span style="color: #0000ff; font-family: Consolas; font-size: x-small;" face="Consolas" color="#0000ff" size="2"><span style="color: #0000ff; font-family: Consolas; font-size: x-small;" face="Consolas" color="#0000ff" size="2"><span style="color: #0000ff; font-family: Consolas; font-size: x-small;" face="Consolas" color="#0000ff" size="2">&gt;</span></span></span></span></span></span></p>
<p>&nbsp;&nbsp;&nbsp; <span style="color: #0000ff; font-family: Consolas; font-size: x-small;" face="Consolas" color="#0000ff" size="2"><span style="color: #0000ff; font-family: Consolas; font-size: x-small;" face="Consolas" color="#0000ff" size="2"><span style="color: #0000ff; font-family: Consolas; font-size: x-small;" face="Consolas" color="#0000ff" size="2">&lt;<span style="color: #a31515; font-family: Consolas; font-size: x-small;" face="Consolas" color="#a31515" size="2"><span style="color: #a31515; font-family: Consolas; font-size: x-small;" face="Consolas" color="#a31515" size="2"><span style="color: #a31515; font-family: Consolas; font-size: x-small;" face="Consolas" color="#a31515" size="2">defaultConnectionFactory</span></span></span><span style="color: #0000ff; font-family: Consolas; font-size: x-small;" face="Consolas" color="#0000ff" size="2"><span style="color: #0000ff; font-family: Consolas; font-size: x-small;" face="Consolas" color="#0000ff" size="2"><span style="color: #0000ff; font-family: Consolas; font-size: x-small;" face="Consolas" color="#0000ff" size="2"> </span></span></span><span style="color: #ff0000; font-family: Consolas; font-size: x-small;" face="Consolas" color="#ff0000" size="2"><span style="color: #ff0000; font-family: Consolas; font-size: x-small;" face="Consolas" color="#ff0000" size="2"><span style="color: #ff0000; font-family: Consolas; font-size: x-small;" face="Consolas" color="#ff0000" size="2">type</span></span></span><span style="color: #0000ff; font-family: Consolas; font-size: x-small;" face="Consolas" color="#0000ff" size="2"><span style="color: #0000ff; font-family: Consolas; font-size: x-small;" face="Consolas" color="#0000ff" size="2"><span style="color: #0000ff; font-family: Consolas; font-size: x-small;" face="Consolas" color="#0000ff" size="2">=</span></span></span><span style="font-family: Consolas; font-size: x-small;" face="Consolas" size="2"><span style="font-family: Consolas; font-size: x-small;" face="Consolas" size="2">"</span></span><span style="color: #0000ff; font-family: Consolas; font-size: x-small;" face="Consolas" color="#0000ff" size="2"><span style="color: #0000ff; font-family: Consolas; font-size: x-small;" face="Consolas" color="#0000ff" size="2"><span style="color: #0000ff; font-family: Consolas; font-size: x-small;" face="Consolas" color="#0000ff" size="2">System.Data.Entity.Infrastructure.SqlConnectionFactory, EntityFramework</span></span></span><span style="font-family: Consolas; font-size: x-small;" face="Consolas" size="2"><span style="font-family: Consolas; font-size: x-small;" face="Consolas" size="2">"</span></span><span style="color: #0000ff; font-family: Consolas; font-size: x-small;" face="Consolas" color="#0000ff" size="2"><span style="color: #0000ff; font-family: Consolas; font-size: x-small;" face="Consolas" color="#0000ff" size="2"><span style="color: #0000ff; font-family: Consolas; font-size: x-small;" face="Consolas" color="#0000ff" size="2">&gt;</span></span></span></span></span></span></p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: #0000ff; font-family: Consolas; font-size: x-small;" face="Consolas" color="#0000ff" size="2"><span style="color: #0000ff; font-family: Consolas; font-size: x-small;" face="Consolas" color="#0000ff" size="2"><span style="color: #0000ff; font-family: Consolas; font-size: x-small;" face="Consolas" color="#0000ff" size="2">&lt;<span style="color: #a31515; font-family: Consolas; font-size: x-small;" face="Consolas" color="#a31515" size="2"><span style="color: #a31515; font-family: Consolas; font-size: x-small;" face="Consolas" color="#a31515" size="2"><span style="color: #a31515; font-family: Consolas; font-size: x-small;" face="Consolas" color="#a31515" size="2">parameters</span></span></span><span style="color: #0000ff; font-family: Consolas; font-size: x-small;" face="Consolas" color="#0000ff" size="2"><span style="color: #0000ff; font-family: Consolas; font-size: x-small;" face="Consolas" color="#0000ff" size="2"><span style="color: #0000ff; font-family: Consolas; font-size: x-small;" face="Consolas" color="#0000ff" size="2">&gt;</span></span></span></span></span></span></p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: #0000ff; font-family: Consolas; font-size: x-small;" face="Consolas" color="#0000ff" size="2"><span style="color: #0000ff; font-family: Consolas; font-size: x-small;" face="Consolas" color="#0000ff" size="2"><span style="color: #0000ff; font-family: Consolas; font-size: x-small;" face="Consolas" color="#0000ff" size="2">&lt;<span style="color: #a31515; font-family: Consolas; font-size: x-small;" face="Consolas" color="#a31515" size="2"><span style="color: #a31515; font-family: Consolas; font-size: x-small;" face="Consolas" color="#a31515" size="2"><span style="color: #a31515; font-family: Consolas; font-size: x-small;" face="Consolas" color="#a31515" size="2">parameter</span></span></span><span style="color: #0000ff; font-family: Consolas; font-size: x-small;" face="Consolas" color="#0000ff" size="2"><span style="color: #0000ff; font-family: Consolas; font-size: x-small;" face="Consolas" color="#0000ff" size="2"><span style="color: #0000ff; font-family: Consolas; font-size: x-small;" face="Consolas" color="#0000ff" size="2"> </span></span></span><span style="color: #ff0000; font-family: Consolas; font-size: x-small;" face="Consolas" color="#ff0000" size="2"><span style="color: #ff0000; font-family: Consolas; font-size: x-small;" face="Consolas" color="#ff0000" size="2"><span style="color: #ff0000; font-family: Consolas; font-size: x-small;" face="Consolas" color="#ff0000" size="2">value</span></span></span><span style="color: #0000ff; font-family: Consolas; font-size: x-small;" face="Consolas" color="#0000ff" size="2"><span style="color: #0000ff; font-family: Consolas; font-size: x-small;" face="Consolas" color="#0000ff" size="2"><span style="color: #0000ff; font-family: Consolas; font-size: x-small;" face="Consolas" color="#0000ff" size="2">=</span></span></span><span style="font-family: Consolas; font-size: x-small;" face="Consolas" size="2"><span style="font-family: Consolas; font-size: x-small;" face="Consolas" size="2">"</span></span><span style="color: #0000ff; font-family: Consolas; font-size: x-small;" face="Consolas" color="#0000ff" size="2"><span style="color: #0000ff; font-family: Consolas; font-size: x-small;" face="Consolas" color="#0000ff" size="2"><span style="color: #0000ff; font-family: Consolas; font-size: x-small;" face="Consolas" color="#0000ff" size="2">Data Source=.; Integrated Security=True; MultipleActiveResultSets=True</span></span></span><span style="font-family: Consolas; font-size: x-small;" face="Consolas" size="2"><span style="font-family: Consolas; font-size: x-small;" face="Consolas" size="2">"</span></span><span style="color: #0000ff; font-family: Consolas; font-size: x-small;" face="Consolas" color="#0000ff" size="2"><span style="color: #0000ff; font-family: Consolas; font-size: x-small;" face="Consolas" color="#0000ff" size="2"><span style="color: #0000ff; font-family: Consolas; font-size: x-small;" face="Consolas" color="#0000ff" size="2"> /&gt;</span></span></span></span></span></span></p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: #0000ff; font-family: Consolas; font-size: x-small;" face="Consolas" color="#0000ff" size="2"><span style="color: #0000ff; font-family: Consolas; font-size: x-small;" face="Consolas" color="#0000ff" size="2"><span style="color: #0000ff; font-family: Consolas; font-size: x-small;" face="Consolas" color="#0000ff" size="2">&lt;/<span style="color: #a31515; font-family: Consolas; font-size: x-small;" face="Consolas" color="#a31515" size="2"><span style="color: #a31515; font-family: Consolas; font-size: x-small;" face="Consolas" color="#a31515" size="2"><span style="color: #a31515; font-family: Consolas; font-size: x-small;" face="Consolas" color="#a31515" size="2">parameters</span></span></span><span style="color: #0000ff; font-family: Consolas; font-size: x-small;" face="Consolas" color="#0000ff" size="2"><span style="color: #0000ff; font-family: Consolas; font-size: x-small;" face="Consolas" color="#0000ff" size="2"><span style="color: #0000ff; font-family: Consolas; font-size: x-small;" face="Consolas" color="#0000ff" size="2">&gt;</span></span></span></span></span></span></p>
<p>&nbsp;&nbsp;&nbsp; <span style="color: #0000ff; font-family: Consolas; font-size: x-small;" face="Consolas" color="#0000ff" size="2"><span style="color: #0000ff; font-family: Consolas; font-size: x-small;" face="Consolas" color="#0000ff" size="2"><span style="color: #0000ff; font-family: Consolas; font-size: x-small;" face="Consolas" color="#0000ff" size="2">&lt;/<span style="color: #a31515; font-family: Consolas; font-size: x-small;" face="Consolas" color="#a31515" size="2"><span style="color: #a31515; font-family: Consolas; font-size: x-small;" face="Consolas" color="#a31515" size="2"><span style="color: #a31515; font-family: Consolas; font-size: x-small;" face="Consolas" color="#a31515" size="2">defaultConnectionFactory</span></span></span><span style="color: #0000ff; font-family: Consolas; font-size: x-small;" face="Consolas" color="#0000ff" size="2"><span style="color: #0000ff; font-family: Consolas; font-size: x-small;" face="Consolas" color="#0000ff" size="2"><span style="color: #0000ff; font-family: Consolas; font-size: x-small;" face="Consolas" color="#0000ff" size="2">&gt;</span></span></span></span></span></span></p>
<p>&nbsp; <span style="color: #0000ff; font-family: Consolas; font-size: x-small;" face="Consolas" color="#0000ff" size="2"><span style="color: #0000ff; font-family: Consolas; font-size: x-small;" face="Consolas" color="#0000ff" size="2"><span style="color: #0000ff; font-family: Consolas; font-size: x-small;" face="Consolas" color="#0000ff" size="2">&lt;/<span style="color: #a31515; font-family: Consolas; font-size: x-small;" face="Consolas" color="#a31515" size="2"><span style="color: #a31515; font-family: Consolas; font-size: x-small;" face="Consolas" color="#a31515" size="2"><span style="color: #a31515; font-family: Consolas; font-size: x-small;" face="Consolas" color="#a31515" size="2">entityFramework</span></span></span><span style="color: #0000ff; font-family: Consolas; font-size: x-small;" face="Consolas" color="#0000ff" size="2"><span style="color: #0000ff; font-family: Consolas; font-size: x-small;" face="Consolas" color="#0000ff" size="2"><span style="color: #0000ff; font-family: Consolas; font-size: x-small;" face="Consolas" color="#0000ff" size="2">&gt;</span></span></span></span></span></span></p>
<p>You only need to change the configuration to match your appropriate connection string.</p>
<p><br />David.</p>]]></content:encoded>
    </item>
  </channel>
</rss>