<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>system.data.objects dev guy : ADO.Net</title><link>http://blogs.msdn.com/dsimmons/archive/tags/ADO.Net/default.aspx</link><description>Tags: ADO.Net</description><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>Why use the Entity Framework?</title><link>http://blogs.msdn.com/dsimmons/archive/2008/05/17/why-use-the-entity-framework.aspx</link><pubDate>Sat, 17 May 2008 22:38:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8517703</guid><dc:creator>dsimmons@microsoft.com</dc:creator><slash:comments>38</slash:comments><comments>http://blogs.msdn.com/dsimmons/comments/8517703.aspx</comments><wfw:commentRss>http://blogs.msdn.com/dsimmons/commentrss.aspx?PostID=8517703</wfw:commentRss><description>&lt;P&gt;There are a number of places where you can read an introduction to the Entity Framework, listen to a podcast about it, or watch a screen cast or video of an interview.&amp;nbsp; Even with these various resources, though, there are so many different data access technologies out there that it's not uncommon for me to get the question: Why should I use the Entity Framework?&amp;nbsp; Or what differentiates it from other options like just using ADO.Net SqlClient and friends, LINQ to SQL or something like nHibernate?&amp;nbsp; I like the second question better, because the truth is that different&amp;nbsp;problems merit different solutions.&amp;nbsp; So here's just a quick take on my perspective about these:&lt;/P&gt;
&lt;P&gt;&lt;U&gt;&lt;STRONG&gt;Entity Framework vs. traditional ADO.Net&lt;/STRONG&gt;&lt;/U&gt;&lt;BR&gt;All of the standard ORM arguments apply here.&amp;nbsp; The highlights are that you can write code against the Entity Framework and the system will automatically produce objects for you as well as track changes on those objects and simplify the process of updating the database.&amp;nbsp; The EF can therefore replace a large chunk of code you would otherwise have to write and maintain yourself.&amp;nbsp; Further, because the mapping between your objects and your database is specified declaratively instead of in code, if you need to change your database schema, you can minimize the impact on the code you have to modify in your applications--so the system provides a level of abstraction which helps isolate the app from the database.&amp;nbsp; Finally, the queries and other operations you write into your code are specified in a syntax that is not specific to any particular database vendor--in ado.net prior to the EF, ado.net provided a common syntax for creating connections, executing queries and processing results, but there was no common language for the queries themselves; ado.net just passed a string from your program down to the provider without manipulating that string at all, and if you wanted to move an app from Oracle to SQL Server, you would have to change a number of the queries.&amp;nbsp; With the EF, the queries are written in LINQ or Entity SQL and then translated at runtime by the providers to the particular back-end query syntax for that database.&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;U&gt;Entity Framework vs. LINQ to SQL&lt;/U&gt;&lt;/STRONG&gt;&lt;BR&gt;The first big difference between the Entity Framework and LINQ to SQL is that the EF has a full provider model which means that as providers come online (and there are several in beta now and many which have committed to release within 3 months of the EF RTM), you will be able to use the EF against not only SQL Server and SQL CE but also Oracle, DB2, Informix, MySQL, Postgres, etc.&lt;/P&gt;
&lt;P&gt;Next there is the fact that LINQ to SQL provides very limited mapping capabilities.&amp;nbsp; For the most part L2S classes must be one-to-one with the database (with the exception of one form of inheritance where there is a single table for all of the entity types in a hierarchy and a discriminator column which indicates which type a particular row represents).&amp;nbsp; In the case of the EF, there is a client-side view engine which can transform queries and updates made to the conceptual model into equivalent operations against the database.&amp;nbsp; The mapping system will produce those views for a variety of transformations.&lt;/P&gt;
&lt;P&gt;You can apply a variety of inheritance strategies: Assume you have an inheritance model with animal, dog:animal &amp;amp; cat:animal.&amp;nbsp; You can not only do what L2S does and create a single table with all the properties from animal, dog &amp;amp; cat plus a column that indicates if a particular row is just a generic animal or a dog or a cat, but you can also have 3 tables where each table has all of the properties of that particular type (the dog table has not only dog-specific columns but also all the same columns as animal), or 3 tables such that the dog and cat tables have only the key plus those properties specific to their type of animal and retrieving a dog object would involve a join between the animal table and the dog table.&amp;nbsp; And you can further combine these strategies so some parts of a hierarchy might live in one table and some parts in separate tables.&lt;/P&gt;
&lt;P&gt;In addition you can do what we call "entity splitting" where a single type has properties which are drawn from two separate tables, and you can model complex types where there is a type which is nested within a larger entity and which doesn't have its own separate identity--it just groups some properties together.&amp;nbsp; The best example of this is something like address where the street, city, state and zip properties go together logically, but they don't have independent identity.&amp;nbsp; The address is only interesting as a set of properties that are part of a customer or whatever.&amp;nbsp; As you have noticed, for v1 you can't create complex types with the designer in the EF--you have to code them by hand in the XML files.&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;U&gt;Entity Framework vs. nHibernate&lt;/U&gt;&lt;/STRONG&gt;&lt;BR&gt;Because nHibernate is a rather full-featured ORM, the distinguishing features between the EF and it are not as large.&amp;nbsp; In fact, it is certainly true that nHibernate is a more mature product and in many ways has more ORM features than the EF.&amp;nbsp; The big difference between the EF and nHibernate is around the Entity Data Model (EDM) and the long-term vision for the data platform we are building around it.&amp;nbsp; The EF was specifically structured to separate the process of mapping queries/shaping results from building objects and tracking changes.&amp;nbsp; This makes it easier to create a conceptual model which is how you want to think about your data and then reuse that conceptual model for a number of other services besides just building objects.&amp;nbsp; Long-term we are working to build EDM awareness into a variety of other Microsoft products so that if you have an Entity Data Model, you should be able to automatically create REST-oriented web services over that model (ADO.Net Data Services aka Astoria), write reports against that model (Reporting Services), synchronize data between a server and an offline client store where the data is moved atomically as entities even if those entities draw from multiple database tables on the server, create workflows from entity-aware building blocks, etc. etc.&amp;nbsp; Not only does this increase the value of the data model by allowing it to be reused for many parts of your overall solution, but it also allows us to invest more heavily in common tools which will streamline the development process, make developer learning apply to more scenarios, etc.&amp;nbsp; So the differentiator is not that the EF supports more flexible mapping than nHibernate or something like that, it's that the EF is not just an ORM--it's the first step in a much larger vision of an entity-aware data platform.&lt;BR&gt;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=8517703" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/dsimmons/archive/tags/Entity+Framework/default.aspx">Entity Framework</category><category domain="http://blogs.msdn.com/dsimmons/archive/tags/ADO.Net/default.aspx">ADO.Net</category></item><item><title>A little more about SP1 Beta and the EF</title><link>http://blogs.msdn.com/dsimmons/archive/2008/05/14/a-little-more-about-sp1-beta-and-the-ef.aspx</link><pubDate>Wed, 14 May 2008 08:45:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8502781</guid><dc:creator>dsimmons@microsoft.com</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.msdn.com/dsimmons/comments/8502781.aspx</comments><wfw:commentRss>http://blogs.msdn.com/dsimmons/commentrss.aspx?PostID=8502781</wfw:commentRss><description>&lt;P&gt;Just a quick note to point out a few interesting things about the updated version of the EF which shipped this week with the beta of VS 2008 / .Net 3.5 SP1:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;The initial announcement didn't include links to updated versions of the documentation or our samples, but you can now &lt;A class="" title="find the docs here" href="http://vs2008sp1docs.msdn.microsoft.com/en-us/ms439009.aspx" mce_href="http://vs2008sp1docs.msdn.microsoft.com/en-us/ms439009.aspx"&gt;find the updated docs here&lt;/A&gt;&amp;nbsp;(including docs for new things like the entity data source) and at least &lt;A class="" title="some of the samples here" href="http://code.msdn.microsoft.com/EFQuerySamples" mce_href="http://code.msdn.microsoft.com/EFQuerySamples"&gt;some of the samples here&lt;/A&gt;.&lt;BR&gt;&lt;BR&gt;&lt;/LI&gt;
&lt;LI&gt;I just made a pass through the &lt;A class="" title="EF FAQ" href="http://blogs.msdn.com/dsimmons/pages/entity-framework-faq.aspx" mce_href="http://blogs.msdn.com/dsimmons/pages/entity-framework-faq.aspx"&gt;EF FAQ&lt;/A&gt; updating things for SP1 Beta, etc.&amp;nbsp; There's still a lot of work needed (please help), but I hope you will find this a useful resource.&lt;BR&gt;&lt;BR&gt;&lt;/LI&gt;
&lt;LI&gt;I highly encourage you to look over &lt;A class="" title="post on the ado.net team blog" href="http://blogs.msdn.com/adonet/archive/2008/05/12/what-s-new-in-the-sp1-beta.aspx" mce_href="http://blogs.msdn.com/adonet/archive/2008/05/12/what-s-new-in-the-sp1-beta.aspx"&gt;the post on the ado.net team blog&lt;/A&gt; for more info about what's new.&amp;nbsp; There should also be a post listing breaking changes there very soon.&lt;BR&gt;&lt;BR&gt;&lt;/LI&gt;
&lt;LI&gt;Finally, let me highlight a couple of the more interesting new features for those of you who have been following my blog and things like my adventures with web services and EntityBag...&amp;nbsp; This release of the EF works in conjunction with updates to WCF made in SP1 to enable out of the box serialization of entity graphs (including cycles).&amp;nbsp; This will make creating web services that return graphs of entities brain-dead simple.&amp;nbsp; It also deals with the known types problem so that inheritance works seemlessly with EF models and WCF services.&amp;nbsp; So a couple of the issues I had to deal with in EntityBag are just solved for you out of the box.&amp;nbsp; &lt;BR&gt;&lt;BR&gt;What it doesn't do, though, is handle change tracking on the client and the like.&amp;nbsp; These are still important topics which we'll work on addressing in v2 of the EF, but in the meantime, I'm going to try to put together an updated version of EntityBag which will work with the new EF bits.&amp;nbsp; It's very likely, though, that this won't appear right away.&amp;nbsp; There's just too many things to do not only around finishing up v1 but we're starting to think deeply about v2, etc.&lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;- Danny&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=8502781" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/dsimmons/archive/tags/Entity+Framework/default.aspx">Entity Framework</category><category domain="http://blogs.msdn.com/dsimmons/archive/tags/ADO.Net/default.aspx">ADO.Net</category></item><item><title>Lazy Loading</title><link>http://blogs.msdn.com/dsimmons/archive/2008/05/12/lazy-loading.aspx</link><pubDate>Mon, 12 May 2008 21:49:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8496055</guid><dc:creator>dsimmons@microsoft.com</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.msdn.com/dsimmons/comments/8496055.aspx</comments><wfw:commentRss>http://blogs.msdn.com/dsimmons/commentrss.aspx?PostID=8496055</wfw:commentRss><description>&lt;P&gt;There's a lot going on today!&amp;nbsp; Not only has VS 2008 SP1 Beta been released (with the EF fully integrated into setup and including a number of new features and bug fixes), but also Jarek Kowalski, who is a really smart colleague on the EF team, put up &lt;A class="" title="the first blog post in a series" href="http://blogs.msdn.com/jkowalski/archive/2008/05/12/transparent-lazy-loading-for-entity-framework-part-1.aspx" mce_href="http://blogs.msdn.com/jkowalski/archive/2008/05/12/transparent-lazy-loading-for-entity-framework-part-1.aspx"&gt;the first blog post in a series&lt;/A&gt; he has written which shows some exciting ways that you can layer some code on top of the EF and achieve lazy loading.&amp;nbsp; The goals for his effort are pretty ambitious, and he has achieved them admirably.&amp;nbsp; You might find this code very useful, and it's also a great sign of the flexibility of the EF.&amp;nbsp; I'm so excited to see these kinds of things popping up both from folks inside Microsoft and those on the&amp;nbsp;outside as well. This is how we translate the work of the EF team into real value for folks on many projects.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;- Danny&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=8496055" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/dsimmons/archive/tags/Entity+Framework/default.aspx">Entity Framework</category><category domain="http://blogs.msdn.com/dsimmons/archive/tags/ADO.Net/default.aspx">ADO.Net</category></item><item><title>Did you know that connection string builders will parse connection strings not just create them?</title><link>http://blogs.msdn.com/dsimmons/archive/2008/01/09/did-you-know-that-connection-string-builders-will-parse-connection-strings-not-just-create-them.aspx</link><pubDate>Thu, 10 Jan 2008 02:15:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:7046720</guid><dc:creator>dsimmons@microsoft.com</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.msdn.com/dsimmons/comments/7046720.aspx</comments><wfw:commentRss>http://blogs.msdn.com/dsimmons/commentrss.aspx?PostID=7046720</wfw:commentRss><description>&lt;P&gt;OK.&amp;nbsp; So this one was new on me.&amp;nbsp; Thanks to my colleague down the hall, Alazel Acheson, (being able to say that, by the way,&amp;nbsp;has got to be one of the coolest things about working at Microsoft -- it's great to be surrounded by very smart people) I was able to quickly solve a little problem that has been bugging me lately.&amp;nbsp; It was such an easy solution and a bit unexpected that I thought I'd share it.&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Background&lt;/STRONG&gt;: The EF uses a connection string for many things including a way to specify the location of your metadata, which store provider you want to use and the connection string for that stored provider.&amp;nbsp; If you really want to talk to the database, you need all those things, but if all you want to do is play with some objects in the ObjectContext/ObjectStateManager, then all you really need is the metadata.&amp;nbsp; Well, actually you also need to know which provider as well for some esoteric reasons we won't discuss right now, but you very specifically do NOT need to know the provider connection string--which is a good thing in some scenarios because provider connection strings can contain sensitive information (like a username and password).&amp;nbsp; &lt;/P&gt;
&lt;P&gt;I've got just one of those scenarios that I'm playing around with these days.&amp;nbsp; Part of my solution runs on the middle tier and has a full connection string, but for another part of my solution I want to serialize some data down to a client box which has the entity framework and everything on it but doesn't need or have access to the database.&amp;nbsp; To make my solution work, I'd like to remove the provider connection string from my overall connection string and only serialize that in order to make sure I don't send any sensitive info to the client.&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Problem:&lt;/STRONG&gt;&amp;nbsp; I really didn't want to write a bunch of code to parse the connection string.&amp;nbsp; Sure we have just that kind of code down in EntityClient, but this solution I'm building lives outside the entity framework, so I needed something publically accessible and easy to use.&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Solution&lt;/STRONG&gt;:&amp;nbsp; EntityConnectionStringBuilder (and all the other connection string builders) has a constructor overload that takes a connection string.&amp;nbsp; If you use that constructor, then it will parse everything out for you so that you can easily modify things and then reconstitute the connection string.&amp;nbsp; In my case, the code looks something like this:&lt;/P&gt;
&lt;P class=MsoNormal style="BACKGROUND: #d9d9d9; MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-background-themecolor: background1; mso-background-themeshade: 217; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;var&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt; csBuilder = &lt;SPAN style="COLOR: blue"&gt;new&lt;/SPAN&gt; &lt;SPAN style="COLOR: #2b91af"&gt;EntityConnectionStringBuilder&lt;/SPAN&gt;(context.Connection.ConnectionString);&lt;?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="BACKGROUND: #d9d9d9; MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-background-themecolor: background1; mso-background-themeshade: 217; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;csBuilder.ProviderConnectionString = &lt;SPAN style="COLOR: blue"&gt;null&lt;/SPAN&gt;;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="BACKGROUND: #d9d9d9; MARGIN: 0in 0in 10pt; mso-background-themecolor: background1; mso-background-themeshade: 217"&gt;&lt;SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;this.connectionString = csBuilder.ConnectionString;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;Couldn't be easier.&amp;nbsp; &lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=7046720" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/dsimmons/archive/tags/Entity+Framework/default.aspx">Entity Framework</category><category domain="http://blogs.msdn.com/dsimmons/archive/tags/ADO.Net/default.aspx">ADO.Net</category></item><item><title>EF Beta 3 is finally available!</title><link>http://blogs.msdn.com/dsimmons/archive/2007/12/06/ef-beta-3-is-finally-available.aspx</link><pubDate>Thu, 06 Dec 2007 19:29:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:6684216</guid><dc:creator>dsimmons@microsoft.com</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.msdn.com/dsimmons/comments/6684216.aspx</comments><wfw:commentRss>http://blogs.msdn.com/dsimmons/commentrss.aspx?PostID=6684216</wfw:commentRss><description>&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt; LINE-HEIGHT: normal; mso-margin-top-alt: auto; mso-margin-bottom-alt: auto"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;It has been a long time in coming (especially for those of you who have installed VS 2008 RTM and then been frustrated about the inability of beta 2 to work with it), but beta 3 of the Entity Framework and CTP 2 of the EF Designer are finally available!&amp;nbsp; &lt;?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt; LINE-HEIGHT: normal; mso-margin-top-alt: auto; mso-margin-bottom-alt: auto"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;There are four steps to get everything installed:&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoListParagraphCxSpFirst style="MARGIN: 0in 0in 0pt 0.5in; TEXT-INDENT: -0.25in; LINE-HEIGHT: normal; mso-list: l1 level1 lfo6; mso-margin-top-alt: auto; mso-margin-bottom-alt: auto; mso-add-space: auto"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: Arial"&gt;&lt;SPAN style="mso-list: Ignore"&gt;0)&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;Uninstall any previous versions of the EF and designer, and install VS 2008 RTM.&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoListParagraphCxSpMiddle style="MARGIN: 0in 0in 0pt 0.5in; TEXT-INDENT: -0.25in; LINE-HEIGHT: normal; mso-list: l1 level1 lfo6; mso-margin-top-alt: auto; mso-margin-bottom-alt: auto; mso-add-space: auto"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: Arial"&gt;&lt;SPAN style="mso-list: Ignore"&gt;1)&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;Install the &lt;A href="http://go.microsoft.com/fwlink/?LinkId=104981"&gt;EF Beta 3 runtime&lt;/A&gt;.&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoListParagraphCxSpMiddle style="MARGIN: 0in 0in 0pt 0.5in; TEXT-INDENT: -0.25in; LINE-HEIGHT: normal; mso-list: l1 level1 lfo6; mso-margin-top-alt: auto; mso-margin-bottom-alt: auto; mso-add-space: auto"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: Arial"&gt;&lt;SPAN style="mso-list: Ignore"&gt;2)&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;Install a &lt;A href="http://go.microsoft.com/fwlink/?LinkId=104985"&gt;&lt;FONT color=#0000ff&gt;patch for the XML Editor&lt;/FONT&gt;&lt;/A&gt; which is necessary for the Designer to work.&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoListParagraphCxSpLast style="MARGIN: 0in 0in 10pt 0.5in; TEXT-INDENT: -0.25in; LINE-HEIGHT: normal; mso-list: l1 level1 lfo6; mso-margin-top-alt: auto; mso-margin-bottom-alt: auto; mso-add-space: auto"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: Arial"&gt;&lt;SPAN style="mso-list: Ignore"&gt;3)&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;Install the &lt;A href="http://go.microsoft.com/fwlink/?LinkId=104983"&gt;&lt;FONT color=#0000ff&gt;EF Tools CTP 2&lt;/FONT&gt;&lt;/A&gt;.&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt; LINE-HEIGHT: normal; mso-margin-top-alt: auto; mso-margin-bottom-alt: auto"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;In addition to being updated so that they work with the RTM versions of .Net Framework 3.5 and VS 2008, these versions include some great improvements.&amp;nbsp; I'll have to defer to the designer team to give more details about that release, but I wanted to share my quick take on what's new in the EF runtime.&amp;nbsp; &lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&lt;/SPAN&gt;I’ll insert my take on things &lt;I style="mso-bidi-font-style: normal"&gt;&lt;SPAN style="COLOR: #31849b; mso-themecolor: accent5; mso-themeshade: 191"&gt;in this color&lt;/SPAN&gt;&lt;/I&gt; after the new features summary lines I've copied from the download page…&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"&gt;&lt;B&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;Performance improvements&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/B&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"&gt;&lt;I style="mso-bidi-font-style: normal"&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: #31849b; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'; mso-themecolor: accent5; mso-themeshade: 191"&gt;A HUGE emphasis for us this milestone was on performance.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;I can’t begin to tell you how much time and effort we spent on these things.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;The above three represent the biggest, most obvious improvements but effort was made throughout the stack.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/I&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"&gt;&lt;I style="mso-bidi-font-style: normal"&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: #31849b; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'; mso-themecolor: accent5; mso-themeshade: 191"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/I&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: #31849b; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'; mso-themecolor: accent5; mso-themeshade: 191"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;
&lt;UL style="MARGIN-TOP: 0in" type=disc&gt;
&lt;LI class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-list: l2 level1 lfo1; tab-stops: list .5in"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;Much quicker object query execution &lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/LI&gt;&lt;/UL&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in; LINE-HEIGHT: normal"&gt;&lt;I style="mso-bidi-font-style: normal"&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: #31849b; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'; mso-themecolor: accent5; mso-themeshade: 191"&gt;By far and away the most expensive part of executing a query with the EF prior to beta 3 was the time taken to assemble the results into the correctly final format for the conceptual model and then construct object instances from that data.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;A major effort was made to change the strategy for this process (which we generally refer to as Object Materialization) by compressing a number of layers and doing dynamic code generation of a larger part of the whole process.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;The result is a noticeable improvement in query speed. &lt;/SPAN&gt;&lt;/I&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in; LINE-HEIGHT: normal"&gt;&lt;I style="mso-bidi-font-style: normal"&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: #31849b; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'; mso-themecolor: accent5; mso-themeshade: 191"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/I&gt;&amp;nbsp;&lt;/P&gt;
&lt;UL style="MARGIN-TOP: 0in" type=disc&gt;
&lt;LI class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-list: l2 level1 lfo1; tab-stops: list .5in"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;Simpler generated SQL &lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/LI&gt;&lt;/UL&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in; LINE-HEIGHT: normal"&gt;&lt;I style="mso-bidi-font-style: normal"&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: #31849b; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'; mso-themecolor: accent5; mso-themeshade: 191"&gt;Another key part of the overall query process is in the SQL generated in the first place.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;A number of individuals remarked in beta 2 and before about the complexity of the queries generated and sent to the server.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;This was another major investment area.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;The result is simpler queries for the database to evaluate (which are also easier for mere mortals like me to understand).&lt;/SPAN&gt;&lt;/I&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in; LINE-HEIGHT: normal"&gt;&lt;I style="mso-bidi-font-style: normal"&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: #31849b; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'; mso-themecolor: accent5; mso-themeshade: 191"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/I&gt;&amp;nbsp;&lt;/P&gt;
&lt;UL style="MARGIN-TOP: 0in" type=disc&gt;
&lt;LI class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-list: l2 level1 lfo1; tab-stops: list .5in"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;Faster view generation&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/LI&gt;&lt;/UL&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in; LINE-HEIGHT: normal"&gt;&lt;I style="mso-bidi-font-style: normal"&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: #31849b; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'; mso-themecolor: accent5; mso-themeshade: 191"&gt;View generation is a part of the EF process which is necessary for the system to be able to query or update the database.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;Essentially this is a step which takes the declarative description of the mapping along with the metadata describing the storage model and the conceptual model and transforms them into an internal data structure which is used when the query or update is actually executed.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;This can happen either at runtime the first time a query or update statement is executed or at compile time.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;Prior to beta 3, for some complex models the time to generate the views could be quite long (it’s really nasty if you find that booting your app takes 5 minutes with the CPU pegged).&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;During beta 2 I would solve this kind of problem by using compile-time viewgen and checking in the results of the generation so that I only had to pay the price when I actually changed the model, but now it’s enough faster that this generally isn’t necessary.&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/I&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;&lt;BR&gt;&lt;B&gt;Easier disconnected operation&lt;o:p&gt;&lt;/o:p&gt;&lt;/B&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"&gt;&lt;I style="mso-bidi-font-style: normal"&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: #31849b; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-weight: bold; mso-themecolor: accent5; mso-themeshade: 191"&gt;Many folks have observed that it can be difficult to use the EF in disconnected scenarios like when building / consuming a webservice or an ASP.Net solution.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;We spent some time this milestone thinking through the scenarios and adding several key improvements to object services to facilitate these scenarios.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/I&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"&gt;&lt;I style="mso-bidi-font-style: normal"&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: #31849b; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-weight: bold; mso-themecolor: accent5; mso-themeshade: 191"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/I&gt;&lt;I style="mso-bidi-font-style: normal"&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: #31849b; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'; mso-themecolor: accent5; mso-themeshade: 191"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/I&gt;&amp;nbsp;&lt;/P&gt;
&lt;UL style="MARGIN-TOP: 0in" type=disc&gt;
&lt;LI class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-list: l0 level1 lfo2; tab-stops: list .5in"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;Public, serializable EntityKey property on EntityReference &lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/LI&gt;&lt;/UL&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in; LINE-HEIGHT: normal"&gt;&lt;I style="mso-bidi-font-style: normal"&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: #31849b; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'; mso-themecolor: accent5; mso-themeshade: 191"&gt;This is probably the biggest improvement.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;It accomplishes several things: 1) Directly exposes relationship stubs (ie. Relationship information which the object state manager knows about but isn’t otherwise exposed in the object graph because only one of the two related objects is in memory). 2) Makes it possible to manually set relationship information in the state manager without having both entities in memory.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;3) Because the EntityKey is serialized along with the entity by default, this means that for most graphs (all except many-to-many relationships), if you serialize each of the entities in the graph and remote them to a different location and then attach all of them to a state manager at that location, the relationship information will be filled in through the state manager and this will cause the graph to be re-created even though only shallow serialization was used for each separate entity.&lt;/SPAN&gt;&lt;/I&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in; LINE-HEIGHT: normal"&gt;&lt;I style="mso-bidi-font-style: normal"&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: #31849b; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'; mso-themecolor: accent5; mso-themeshade: 191"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/I&gt;&amp;nbsp;&lt;/P&gt;
&lt;UL style="MARGIN-TOP: 0in" type=disc&gt;
&lt;LI class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-list: l0 level1 lfo2; tab-stops: list .5in"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;ApplyPropertyChanges &lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/LI&gt;&lt;/UL&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in; LINE-HEIGHT: normal"&gt;&lt;I style="mso-bidi-font-style: normal"&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: #31849b; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'; mso-themecolor: accent5; mso-themeshade: 191"&gt;Given an entity which is already attached to a state manager and another object which represents a new, updated version of that same entity, you can use this method to compare the two entities and record differences as changes.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/I&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in; LINE-HEIGHT: normal"&gt;&lt;I style="mso-bidi-font-style: normal"&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: #31849b; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'; mso-themecolor: accent5; mso-themeshade: 191"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&lt;/SPAN&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/I&gt;&amp;nbsp;&lt;/P&gt;
&lt;UL style="MARGIN-TOP: 0in" type=disc&gt;
&lt;LI class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-list: l0 level1 lfo2; tab-stops: list .5in"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;Attach on EntityReference &lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/LI&gt;&lt;/UL&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in; LINE-HEIGHT: normal"&gt;&lt;I style="mso-bidi-font-style: normal"&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: #31849b; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'; mso-themecolor: accent5; mso-themeshade: 191"&gt;If you have two entity instances which you know are related in the store but the state manager is unaware of that relationship, then you can call Attach on the EntityReference to notify the state manager—just like you can call attach on the context to notify the state manager of an entity that already exists in the database.&lt;/SPAN&gt;&lt;/I&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in; LINE-HEIGHT: normal"&gt;&lt;I style="mso-bidi-font-style: normal"&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: #31849b; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'; mso-themecolor: accent5; mso-themeshade: 191"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/I&gt;&amp;nbsp;&lt;/P&gt;
&lt;UL style="MARGIN-TOP: 0in" type=disc&gt;
&lt;LI class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-list: l0 level1 lfo2; tab-stops: list .5in"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;Improvements to EntityKey serialization&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/LI&gt;&lt;/UL&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in; LINE-HEIGHT: normal"&gt;&lt;I style="mso-bidi-font-style: normal"&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: #31849b; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'; mso-themecolor: accent5; mso-themeshade: 191"&gt;There was a bug in beta 2 (now fixed) which caused entities with EntityKeys not to serialize the EntityKey along with the rest of the entity data.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;A variety of additional improvements were made to increase the reliability of EntityKey serialization.&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/I&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;&lt;BR&gt;&lt;B&gt;Extensibility and business logic enhancements&lt;o:p&gt;&lt;/o:p&gt;&lt;/B&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"&gt;&lt;I style="mso-bidi-font-style: normal"&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: #31849b; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-weight: bold; mso-themecolor: accent5; mso-themeshade: 191"&gt;Because of some very unpleasant object lessons associated with other components we’ve worked on where&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;too many events were added without thinking them all the way through, we are taking a pretty conservative approach to extensibility in the EF.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;Events and other extensibility mechanisms have been added as we could convince ourselves that they were both critical and well thought-out.&lt;/SPAN&gt;&lt;/I&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"&gt;&lt;I style="mso-bidi-font-style: normal"&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: #31849b; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-weight: bold; mso-themecolor: accent5; mso-themeshade: 191"&gt;&lt;/SPAN&gt;&lt;/I&gt;&lt;I style="mso-bidi-font-style: normal"&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: #31849b; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'; mso-themecolor: accent5; mso-themeshade: 191"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/I&gt;&amp;nbsp;&lt;/P&gt;
&lt;UL style="MARGIN-TOP: 0in" type=disc&gt;
&lt;LI class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-list: l3 level1 lfo3; tab-stops: list .5in"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;Partial methods in code generation for property changing and property changed events &lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/LI&gt;&lt;/UL&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in; LINE-HEIGHT: normal"&gt;&lt;I style="mso-bidi-font-style: normal"&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: #31849b; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'; mso-themecolor: accent5; mso-themeshade: 191"&gt;Now generated entity classes include declarations of partial methods and calls to those methods before and after setting each property value.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;The partial method mechanism is great because the compiler completely optimizes away the method calls if no implementation is supplied.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;The naming convention we use is On&amp;lt;PropertyName&amp;gt;Changing and On&amp;lt;PropertyName&amp;gt;Changed.&lt;/SPAN&gt;&lt;/I&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in; LINE-HEIGHT: normal"&gt;&lt;I style="mso-bidi-font-style: normal"&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: #31849b; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'; mso-themecolor: accent5; mso-themeshade: 191"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/I&gt;&amp;nbsp;&lt;/P&gt;
&lt;UL style="MARGIN-TOP: 0in" type=disc&gt;
&lt;LI class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-list: l3 level1 lfo3; tab-stops: list .5in"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;Load with MergeOption&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/LI&gt;&lt;/UL&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in; LINE-HEIGHT: normal"&gt;&lt;I style="mso-bidi-font-style: normal"&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: #31849b; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'; mso-themecolor: accent5; mso-themeshade: 191"&gt;This makes it possible to refresh the set of related entities (and the portion of an entity graph which models that—a reference or collection) with well-defined semantics.&lt;/SPAN&gt;&lt;/I&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in; LINE-HEIGHT: normal"&gt;&lt;I style="mso-bidi-font-style: normal"&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: #31849b; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'; mso-themecolor: accent5; mso-themeshade: 191"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/I&gt;&amp;nbsp;&lt;/P&gt;
&lt;UL style="MARGIN-TOP: 0in" type=disc&gt;
&lt;LI class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-list: l3 level1 lfo3; tab-stops: list .5in"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;AssociationChanged event&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/LI&gt;&lt;/UL&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in; LINE-HEIGHT: normal"&gt;&lt;I style="mso-bidi-font-style: normal"&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: #31849b; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'; mso-themecolor: accent5; mso-themeshade: 191"&gt;This event is exposed on both collections and references—think “collection changed” (fires for adds and deletes) but on both types of relationship objects.&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/I&gt;&lt;/P&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"&gt;&lt;BR&gt;&lt;B&gt;Query improvements&lt;/B&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"&gt;&lt;STRONG&gt;&lt;/STRONG&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;
&lt;UL style="MARGIN-TOP: 0in" type=disc&gt;
&lt;LI class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-list: l5 level1 lfo4; tab-stops: list .5in"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;Additional canonical functions for LINQ to Entities &lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/LI&gt;&lt;/UL&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in; LINE-HEIGHT: normal"&gt;&lt;I style="mso-bidi-font-style: normal"&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: #31849b; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'; mso-themecolor: accent5; mso-themeshade: 191"&gt;The canonical functions are those which all providers are expected to support.&lt;/SPAN&gt;&lt;/I&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in; LINE-HEIGHT: normal"&gt;&lt;I style="mso-bidi-font-style: normal"&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: #31849b; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'; mso-themecolor: accent5; mso-themeshade: 191"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/I&gt;&amp;nbsp;&lt;/P&gt;
&lt;UL style="MARGIN-TOP: 0in" type=disc&gt;
&lt;LI class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-list: l5 level1 lfo4; tab-stops: list .5in"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;Apply operator elimination (makes more operations work in SQL Server 2000 and other databases) &lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/LI&gt;&lt;/UL&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in; LINE-HEIGHT: normal"&gt;&lt;I style="mso-bidi-font-style: normal"&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: #31849b; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'; mso-themecolor: accent5; mso-themeshade: 191"&gt;The apply operator is a query capability which was added in SQL Server 2005.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;It’s very effective in some scenarios but unfortunately I’m not aware of any other databases which implement it (as soon as I say that someone will point one out, but in any case most databases do not).&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;Prior to beta 3 this operator was used in a great many scenarios making the provider story for the EF surprisingly complicated.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;So, we worked to rewrite queries with this operator so that it isn’t required except in a very few scenarios (like when you use apply yourself in an eSQL query).&lt;/SPAN&gt;&lt;/I&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in; LINE-HEIGHT: normal"&gt;&lt;I style="mso-bidi-font-style: normal"&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: #31849b; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'; mso-themecolor: accent5; mso-themeshade: 191"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/I&gt;&amp;nbsp;&lt;/P&gt;
&lt;UL style="MARGIN-TOP: 0in" type=disc&gt;
&lt;LI class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-list: l5 level1 lfo4; tab-stops: list .5in"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;Compiled LINQ query &lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/LI&gt;&lt;/UL&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in; LINE-HEIGHT: normal"&gt;&lt;I style="mso-bidi-font-style: normal"&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: #31849b; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'; mso-themecolor: accent5; mso-themeshade: 191"&gt;This really ought to be listed under “Performance Improvements” as well because it can make a big difference in the performance of LINQ queries.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;We list it here, though, because it also has an impact on the semantics of the query by making the binding to variables in the surrounding context more explicit.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;Check &lt;/SPAN&gt;&lt;/I&gt;&lt;A href="http://blogs.msdn.com/alexj/archive/2007/11/20/compiled-queries-and-the-entityframework.aspx"&gt;&lt;I style="mso-bidi-font-style: normal"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;&lt;FONT color=#0000ff&gt;this post&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/I&gt;&lt;/A&gt;&lt;I style="mso-bidi-font-style: normal"&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: #31849b; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'; mso-themecolor: accent5; mso-themeshade: 191"&gt; by Alex James out for more details.&lt;/SPAN&gt;&lt;/I&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in; LINE-HEIGHT: normal"&gt;&lt;I style="mso-bidi-font-style: normal"&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: #31849b; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'; mso-themecolor: accent5; mso-themeshade: 191"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/I&gt;&amp;nbsp;&lt;/P&gt;
&lt;UL style="MARGIN-TOP: 0in" type=disc&gt;
&lt;LI class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-list: l5 level1 lfo4; tab-stops: list .5in"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;ToTraceString() method on ObjectQuery&amp;lt;T&amp;gt; and EntityCommand to facilitate debugging&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/LI&gt;&lt;/UL&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in; LINE-HEIGHT: normal"&gt;&lt;I style="mso-bidi-font-style: normal"&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: #31849b; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'; mso-themecolor: accent5; mso-themeshade: 191"&gt;Now you can get the translated query text which will execute on the database from an EntityCommand or an ObjectQuery&amp;lt;T&amp;gt; by just calling this method.&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/I&gt;&lt;/P&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"&gt;&lt;BR&gt;&lt;B&gt;Other&lt;/B&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"&gt;&lt;STRONG&gt;&lt;/STRONG&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;
&lt;UL style="MARGIN-TOP: 0in" type=disc&gt;
&lt;LI class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-list: l4 level1 lfo5; tab-stops: list .5in"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;Connection management refinements &lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/LI&gt;&lt;/UL&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in; LINE-HEIGHT: normal"&gt;&lt;I style="mso-bidi-font-style: normal"&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: #31849b; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'; mso-themecolor: accent5; mso-themeshade: 191"&gt;Prior to beta 3 the object context would open the underlying connection right away when it was constructed in order to gather some key metadata from it.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;Now that open operation is delayed until it is required.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;The overall summary of connection management is that by default the context will open the connection before a query or update operation and automatically close it afterwards.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;If you want to keep a connection open across multiple operations, you can open it explicitly (context.Connection.Open()) in which case you will need to close it yourself, or it will be closed when the context is disposed&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;if the context constructed the connection (rather than it being created by your code and passed into the context’s constructor).&lt;/SPAN&gt;&lt;/I&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in; LINE-HEIGHT: normal"&gt;&lt;I style="mso-bidi-font-style: normal"&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: #31849b; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'; mso-themecolor: accent5; mso-themeshade: 191"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/I&gt;&amp;nbsp;&lt;/P&gt;
&lt;UL style="MARGIN-TOP: 0in" type=disc&gt;
&lt;LI class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-list: l4 level1 lfo5; tab-stops: list .5in"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;Provider interface allows better reasoning about primitive types&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/LI&gt;&lt;/UL&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in; LINE-HEIGHT: normal"&gt;&lt;I style="mso-bidi-font-style: normal"&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: #31849b; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'; mso-themecolor: accent5; mso-themeshade: 191"&gt;Essentially this is a matter of the EF admitting that primitive types and the details of the semantics around them are determined by the backend database/provider and the EF should avoid reasoning about them as much as possible—when it does need to reason about them it does so using information which the provider supplies.&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/I&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"&gt;&lt;I style="mso-bidi-font-style: normal"&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: #31849b; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'; mso-themecolor: accent5; mso-themeshade: 191"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/I&gt;&lt;/P&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: #31849b; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'; mso-themecolor: accent5; mso-themeshade: 191"&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;&lt;FONT color=#000000&gt;In addition to the above list there were, of course, a number of bug fixes and other assorted adjustments.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&lt;/SPAN&gt;See the &lt;/FONT&gt;&lt;A href="http://blogs.msdn.com/adonet/"&gt;ADO.Net team blog&lt;/A&gt;&lt;FONT color=#000000&gt; for the breaking changes doc for details about the ones you are most likely to encounter right away if you have code written against beta 2 that you want to move forward.&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;&lt;FONT color=#000000&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;&lt;FONT color=#000000&gt;Here's hoping that you will enjoy the improvements.&amp;nbsp; As always, I'd love to hear about your experiences with the EF, criticisms, thoughts for how we can improve it, etc.&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;&lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;- Danny&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;&lt;o:p&gt;&lt;FONT face=Calibri size=3&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=6684216" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/dsimmons/archive/tags/Entity+Framework/default.aspx">Entity Framework</category><category domain="http://blogs.msdn.com/dsimmons/archive/tags/ADO.Net/default.aspx">ADO.Net</category></item><item><title>Question: Deep serialization of an object graph--how deep should it go?</title><link>http://blogs.msdn.com/dsimmons/archive/2007/11/20/quesiton-deep-serialization-of-an-object-graph-how-deep-should-it-go.aspx</link><pubDate>Tue, 20 Nov 2007 10:18:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:6425681</guid><dc:creator>dsimmons@microsoft.com</dc:creator><slash:comments>10</slash:comments><comments>http://blogs.msdn.com/dsimmons/comments/6425681.aspx</comments><wfw:commentRss>http://blogs.msdn.com/dsimmons/commentrss.aspx?PostID=6425681</wfw:commentRss><description>&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Arial','sans-serif'"&gt;So, I've been thinking lately about serializing/remoting object graphs.&amp;nbsp; &lt;/SPAN&gt;&lt;?xml:namespace prefix = v ns = "urn:schemas-microsoft-com:vml" /&gt;&lt;v:rect id=_x0000_s1026 style="MARGIN-TOP: 0px; Z-INDEX: 251660288; MARGIN-LEFT: 977.9pt; WIDTH: 228.8pt; POSITION: absolute; HEIGHT: 178.95pt; flip: x; mso-width-percent: 400; mso-top-percent: 160; mso-wrap-distance-top: 7.2pt; mso-wrap-distance-bottom: 7.2pt; mso-position-horizontal: right; mso-position-horizontal-relative: margin; mso-position-vertical: top; mso-position-vertical-relative: margin; mso-width-relative: margin; v-text-anchor: middle" o:allowincell="f" filled="f" fillcolor="black [3213]" strokecolor="black [3213]" strokeweight="1.5pt"&gt;&lt;v:shadow opacity=".5" color="#f79646 [3209]" offset="-15pt,0" offset2="-18pt,12pt"&gt;&lt;/v:shadow&gt;&lt;v:textbox style="mso-next-textbox: #_x0000_s1026; mso-fit-shape-to-text: t" inset="21.6pt,21.6pt,21.6pt,21.6pt"&gt;&lt;/v:textbox&gt;&lt;?xml:namespace prefix = w ns = "urn:schemas-microsoft-com:office:word" /&gt;&lt;w:wrap type="square" anchorx="margin" anchory="margin"&gt;&lt;/w:wrap&gt;&lt;/v:rect&gt;The entity framework currently serializes an entire object graph when binary serialization is used but only serializes one entity at a time in XML/DataContract scenarios.&amp;nbsp; I'm working on a sample designed to show how graphs can be serialized, and we're looking into ways to make this even simpler/more automatic.&amp;nbsp; In the process, though, an issue has come up that has me concerned: What if the graph in memory can vary in size?&amp;nbsp; Might you want to serialize only a subset of the graph, and if so how should that subset be specified?&amp;nbsp; Would it always be the same or might you want to specify different subsets for different operations?&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;To give some context, let's take an example:&amp;nbsp;&amp;nbsp; Assume we have a model with Customers, Orders, OrderLines and Products.&amp;nbsp; Now let's assume that the reason we're serializing things is that we have a web mehtod which returns a customer.&amp;nbsp; With the EF today and a method that just directly returns a customer you would only get the customer, but let's assume for the moment that you could easily indicate that a whole graph should be returned rather than just a single entity.&amp;nbsp; If that were the case, then there are a few possibilities:&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;&amp;nbsp;1) The entire graph connected to the customer is returned every time.&amp;nbsp; If you are building a stateless webservice, then you would likely construct a new ObjectContext instance each time the method is called, retrieve from the DB just those entities you want to return and then return them.&amp;nbsp; In this scenario, returning the entire graph every time works just fine because the entire graph contains exactly what you want to return.&amp;nbsp; &lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;What if the context is maintained across multiple operations, though?&amp;nbsp; Then everything would still be fine as long as other data retrieved into that context is disjoint from the graph containing the customer you want to return.&amp;nbsp; You could, for instance, retrieve customer1, all of that customer's orders and all of those orders' orderlines as well as customer2 and all of their orders and orderlines and returning customer1 would be unaffected by the fact that customer2 had been loaded into the context.&amp;nbsp; The moment you retrieve into that context a product which has been ordered by both customer1 and customer2, though, those two subgraphs become part of a larger graph, and returning either customer would actually cause the full graph including both customers and all their orders to be returned.&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;2) One way to address the potential issue with option 1 would be to remove certain navigation properties or annotate some of them to indicate that serialization should stop at that point.&amp;nbsp; So, in the specific example above, the relationship from product back to the orderlines containing that product could be marked so that serializaiton wouldn't travel over it.&amp;nbsp; This would allow a customer graph including products to be returned without that ever leading to the graph for multiple customers being returned all at once.&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;The problem with this approach, though, is that you might want some web methods to serialize different subgaphs than others.&amp;nbsp; What if you wanted to add to the method that returns a customer a different method which returns a product and all of the orders that contain an instance of that product?&amp;nbsp; In that case, the annotation indicating that products should not serialize the order lines that reference them (necessary to make the customer returning method work&amp;nbsp;correctly)&amp;nbsp;would prevent the products returning method from working as intended.&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;3) So, another approach altogether would be to have some mechanism to indicate on a method-by-method basis what subgraph to return.&amp;nbsp; Naturally, this kind of mechanism provides the most flexibility, but it's also the most complicated to build and to explain, and it generates other questions like: Is it OK to always serialize all members of a collection as long as that collection is included, or are there scenarios where you would want to perform a filtered serialization where only part of a collection is serialized even though the whole thing is present in memory?&lt;/P&gt;&lt;/BLOCKQUOTE&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;So, what do you think?&amp;nbsp; I could really use the feedback.&amp;nbsp; Binary serialization already uses option #1 above, and part of me thinks that option #1 may well be good enough for almost all scenarios.&amp;nbsp; There's no doubt that it would be a LOT simpler to build and to explain, but if there are important, common scenarios where it isn't good enough, then maybe we need to take on #3.&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;Thanks,&lt;BR&gt;Danny&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=6425681" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/dsimmons/archive/tags/Entity+Framework/default.aspx">Entity Framework</category><category domain="http://blogs.msdn.com/dsimmons/archive/tags/ADO.Net/default.aspx">ADO.Net</category></item><item><title>An Interesting Relationship Mapping Scenario</title><link>http://blogs.msdn.com/dsimmons/archive/2007/11/18/an-interesting-relationship-mapping-scenario.aspx</link><pubDate>Sun, 18 Nov 2007 08:47:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:6356260</guid><dc:creator>dsimmons@microsoft.com</dc:creator><slash:comments>10</slash:comments><comments>http://blogs.msdn.com/dsimmons/comments/6356260.aspx</comments><wfw:commentRss>http://blogs.msdn.com/dsimmons/commentrss.aspx?PostID=6356260</wfw:commentRss><description>&lt;P&gt;This week on the ADO.Net pre-release forum, someone brought up an interesting relationship mapping scenario in &lt;A class="" title="this thread" href="http://forums.microsoft.com/MSDN/showpost.aspx?postid=2414378&amp;amp;siteid=1" mce_href="http://forums.microsoft.com/MSDN/showpost.aspx?postid=2414378&amp;amp;siteid=1"&gt;this thread&lt;/A&gt;.&amp;nbsp; Essentially the scenario is this:&amp;nbsp; They have a table which represents an entity, call it Foo, and along with the other columns, the Foo table has a column which is an foreign key ID and another column which denotes a type.&amp;nbsp; Foo entities have relationships with three other entities, call them A, B &amp;amp; C, but they can only have one relationship at any one time.&amp;nbsp; The type indicates which relationship is in use, and the ID is then treated as a foreign key to which ever table the type indicates.&lt;/P&gt;
&lt;P&gt;On one level, this makes perfect sense even if it's not the same kind of pattern we usually think about, but on another level it's not hard to see why the EF (and other ORMs) do not support this out of the box.&amp;nbsp; The problem is that there's no good way to describe in the conceptual model the fact that an instance of Foo can only have one of the three relationships at any particular time.&amp;nbsp; The object model would actually end up with references to all three types, so it would be all too easy to set more than one of those references to a non-null value and then not be able to save changes because there's only one ID column.&lt;/P&gt;
&lt;P&gt;Nevertheless, here's a customer whose database funcitons this way today with hand-written code, and it seems like we ought to be able to do something with the EF.&amp;nbsp; So after some thought, I came up with a few alternatives:&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;&lt;U&gt;Option #1: Use inheritance and relationships between subtypes.&lt;BR&gt;&lt;/U&gt;It's not hard to figure that this solution won't work in many situations, but if it will work for a particular situaiton, then it's the most natural option.&amp;nbsp; Basically the idea is to use the type field to create a TPH inheritance hierarchy of FOO types.&amp;nbsp; You could call them FooA, FooB &amp;amp; FooC, where each of these subtypes has a relationship to one of the other types.&amp;nbsp; The nice thing about it is that the conceptual model now understands that only one relationship can be in place at a time, and the object model matches as well since each type only has one reference to the other type which it can be related to.&amp;nbsp; There are two major problems, though:&amp;nbsp; First off, Foo might already have or be part of another inheritance hierarchy in which case inheritance isn't really an option.&amp;nbsp; Secondly, this mechanism assumes that any one Foo instance has the same relationship throughout its life.&amp;nbsp; It would not be possible to take a FooA and decide later to relate it to B instead, because that would require destroying the instance of FooA and creating a new instance of FooB.&lt;/P&gt;
&lt;P&gt;&lt;U&gt;Option #2: Use a view to transform the storage table plus sprocs for updates.&lt;BR&gt;&lt;/U&gt;A more creative approach would be to create a view in the database which does not expose the ID &amp;amp; type columns directly the way the underlying tables does but instead exposes 3 different ID columns--call them IdA, IdB, &amp;amp; IdC--each of which has the ID value only if the type indicates a realtionship to the corresponding entity and otherwise is null.&amp;nbsp; Once you do that, Foo can have three null-able relationships where the association sets are mapped only if the value is non-null.&amp;nbsp; That way, only one of the relationships would be active at a time.&amp;nbsp; The Foo object model would have 3 references but two of them would be null at any one time.&amp;nbsp; No inheritance hierarchy would be needed, and instances could change which other entity they are related to just by setting the appropriate reference to a non-null value and the other ones to nulls.&amp;nbsp; The downside is that you have to write the view and, more importantly, that all updates would have to go through stored procs since such a view would not be directly updateable.&amp;nbsp; Essentially this mechanism would fool the entity framework into thinking that the database looks differently than it actually does, and it would depend on the sprocs to enforce validation of the relationships when updating rather than doing the enforcement itself.&lt;/P&gt;
&lt;P&gt;&lt;U&gt;Option #3 (in a future EF release): Model the relationships as containment.&lt;/U&gt;&lt;BR&gt;One last possibility which I'll mention is that we have talked about adding to the EF in a future release the idea of a containment relationship.&amp;nbsp; The basic idea of this construct is that "child" entities maybe related to one or more "parent" entities but only one parent at a time.&amp;nbsp; This would then allow the conceptual model to more directly represent the idea in the database, and we would then be able to create a declarative mapping for the scenario.&amp;nbsp; I will point out, though, that this definitely won't make v1, and there are still a number of details to work out in the design.&lt;/P&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;While probably none of these is exactly what the original requester had in mind, I was pleased to discover that the EF is flexible enough to provide some decent alternatives.&lt;/P&gt;
&lt;P&gt;- Danny&lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=6356260" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/dsimmons/archive/tags/Entity+Framework/default.aspx">Entity Framework</category><category domain="http://blogs.msdn.com/dsimmons/archive/tags/ADO.Net/default.aspx">ADO.Net</category></item><item><title>First draft of an EF FAQ posted</title><link>http://blogs.msdn.com/dsimmons/archive/2007/11/08/first-draft-of-an-ef-faq-posted.aspx</link><pubDate>Thu, 08 Nov 2007 14:02:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:5983971</guid><dc:creator>dsimmons@microsoft.com</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.msdn.com/dsimmons/comments/5983971.aspx</comments><wfw:commentRss>http://blogs.msdn.com/dsimmons/commentrss.aspx?PostID=5983971</wfw:commentRss><description>&lt;P&gt;One of the PMs on the team, Asad Khan, sent me a list of questions and answers which he culled from looking through a whole bunch of forum postings and blogs, and the content seemed like such a useful resource that I've been hacking on it for several hours tonight trying to fill in a few holes, organize a bit more and generally get it in a form suitable for posting...&amp;nbsp; You can find the fruits of that effort at: &lt;A href="http://blogs.msdn.com/dsimmons/pages/entity-framework-faq.aspx"&gt;http://blogs.msdn.com/dsimmons/pages/entity-framework-faq.aspx&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;It's now 3am and sitting here in my hotel room at DevConnections I just don't have the patience to figure out how to get word to properly format the table of contents I was working on so that you can navigate from a list of topics and quesitons to the answers.&amp;nbsp; Sorry.&amp;nbsp; So I've posted the doc as is without a table of contents and that will have to do for now.&amp;nbsp; Clearly the document as a whole is just a starting point.&amp;nbsp; There's lots of additional data needed, but hopefully some of you will find this useful.&amp;nbsp; If you find something that isn't there which should be, please post a comment or drop me an email so we can revise the doc.&amp;nbsp; Even better, if you've got an answer that you'd like to add, please send that!&lt;/P&gt;
&lt;P&gt;- Danny&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=5983971" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/dsimmons/archive/tags/Entity+Framework/default.aspx">Entity Framework</category><category domain="http://blogs.msdn.com/dsimmons/archive/tags/ADO.Net/default.aspx">ADO.Net</category></item><item><title>Two specific ways to take more control of your object model</title><link>http://blogs.msdn.com/dsimmons/archive/2007/10/10/two-specific-ways-to-take-more-control-of-your-object-model.aspx</link><pubDate>Wed, 10 Oct 2007 03:52:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:5387466</guid><dc:creator>dsimmons@microsoft.com</dc:creator><slash:comments>4</slash:comments><comments>http://blogs.msdn.com/dsimmons/comments/5387466.aspx</comments><wfw:commentRss>http://blogs.msdn.com/dsimmons/commentrss.aspx?PostID=5387466</wfw:commentRss><description>&lt;P&gt;There was an &lt;A class="" title="interesting discussion" href="http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=573966&amp;amp;SiteID=1" mce_href="http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=573966&amp;amp;SiteID=1"&gt;interesting discussion&lt;/A&gt; on the LINQ Project General forum today (scroll down toward the end where we start talking about what the EF can and cannot do), and there were a couple of key points I wanted to capture since we've had so many discussions about persistence ignorance.&amp;nbsp; Two things which are requested fairly often when folks start to get serious about the object model they expose with their entities are:&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;Making the default constructor private / forcing consumers to use factory methods.&lt;BR&gt;&lt;/LI&gt;
&lt;LI&gt;Creating read-only properties.&lt;/LI&gt;&lt;/OL&gt;
&lt;P&gt;Neither of these happens by default with the code generated from the EF designer or from edmgen, but both are possible (even fairly straightforward) to do with the EF, so I want to make sure folks know about this.&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;U&gt;Getting rid of the&amp;nbsp;public parameterless constructor&lt;/U&gt;&lt;/STRONG&gt;&amp;nbsp;&lt;BR&gt;First off, it's important to realize that the EF does require that there be a parameterless constructor for each entity type (as described&amp;nbsp;&lt;A class="" title="in this previous post" href="http://blogs.msdn.com/dsimmons/archive/2007/05/03/celebrating-the-death-of-dofinalconstruction.aspx" mce_href="http://blogs.msdn.com/dsimmons/archive/2007/05/03/celebrating-the-death-of-dofinalconstruction.aspx"&gt;in this previous post&lt;/A&gt;).&amp;nbsp; This constructor is used by the system when materializing the results of queries.&amp;nbsp; This constructor does not, however, have to be public.&amp;nbsp; So if you want other consumers of your object model (such as an app developer--not the EF itself) to always use a constructor which takes a set of required parameters or to use a factory method, then you can just declare a private parameterless constructor in your partial class (or your own class directly if you are using IPOCO rather than the generated code).&amp;nbsp; This constructor can have business logic for initializing your entity if necessary, and it will be called when materializing objects from the database.&amp;nbsp; Consumers of your class will have to call some other public constructor or factory method you supply.&lt;/P&gt;
&lt;P&gt;Another request which has been made, by the way,&amp;nbsp;is that the mapping should make it possible to specify a constructor with parameters or a factory method which even the EF will use instead of the parameterless constructor.&amp;nbsp; This is something we will consider for future releases, but it won't be a part of the first release of the EF.&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;U&gt;Creating read-only properties&lt;BR&gt;&lt;/U&gt;&lt;/STRONG&gt;This one is a bit harder because there's no straightforward way to do it with the automatically generated code.&amp;nbsp; If you are writing your own class, though, it's simple.&amp;nbsp; Just make the property which the EF persists private and then create a new public property with only a getter.&amp;nbsp; Unfortunately the EF will not allow you to attribute a field directly--it must be a property, and that property must (in the first version of the EF) have the exact same name as the corresponding property in your conceptual model, but there's nothing in the system which forces you to make that property public.&amp;nbsp; &lt;/P&gt;
&lt;P&gt;So, if you want to try this out real quick, you can just take the output of codegen and change the property from public to private and then add a new property to your partial class which is public and has only a getter which access the private property (or the field directly).&amp;nbsp; The EF will use the getter and setter of the property which matches the conceptual model when materializing query results or reading data to write back to the database, but the consumers of your object model will only have access to your public property which can be read-only and/or have various additional business logic in it.&lt;/P&gt;
&lt;P&gt;NOTE: I do not normally recommend editting the output of the code generator because if you ever need to regenerate your code these changes will be lost.&amp;nbsp; This is just a quick way to try out this capability of the EF.&amp;nbsp; If you need to make your persisted properties private, then you will need to switch to maintaining your own data classes either by taking a one-time snapshot of the output of codegen and then manually modifying the class from there on or outright writing your own IPOCO classes.&lt;/P&gt;
&lt;P&gt;- Danny&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=5387466" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/dsimmons/archive/tags/Entity+Framework/default.aspx">Entity Framework</category><category domain="http://blogs.msdn.com/dsimmons/archive/tags/ADO.Net/default.aspx">ADO.Net</category></item><item><title>Concepts Part I: Getting an entity model up and running</title><link>http://blogs.msdn.com/dsimmons/archive/2007/09/15/concepts-part-i-connection-strings-context-lifetimes-metadata-resources.aspx</link><pubDate>Sat, 15 Sep 2007 19:18:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:4937061</guid><dc:creator>dsimmons@microsoft.com</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.msdn.com/dsimmons/comments/4937061.aspx</comments><wfw:commentRss>http://blogs.msdn.com/dsimmons/commentrss.aspx?PostID=4937061</wfw:commentRss><description>&lt;P&gt;I've been thinking for a while about a series of blog posts I'd like to write explaining various Entity Framework concepts, particularly those related directly to writing code using the framework--by that I mean that I will concentrate more on using the API to write object-oriented programs which do data access and less on some other kinds of topics like writing and debugging the XML mapping, using the designer, etc.&amp;nbsp; Some of this will be pretty basic, but many of them are the kinds of things that come up fairly often in our own internal discussions as well as on the forums and such.&amp;nbsp; Hopefully this will be valuable, please let me know what you think, if there are topics you would especially like me to cover, or if there's anything I can do to make it more useful.&lt;/P&gt;
&lt;P&gt;I'm going to use a common model/database for my samples which I call DPMud.&amp;nbsp; It's something that a few friends and I created and maintain as a fun side-project which is an old-style multi-user text adventure (MUD) built using the entity framework.&amp;nbsp; The architecture is not something that will scale well (every real-time event in the system persists to the database, and users learn about events by querying the database), but it works reasonably well for a few users at a time, it's an environment which is very convenient for us to develop in, and it has turned out to be a decent example for exercising all sorts of entity framework functionality.&amp;nbsp; It even does a reasonable job of stressing the system.&amp;nbsp; &lt;/P&gt;
&lt;P&gt;In order to help you get a feel for the model, here's an abbreviated version of the diagram:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;IMG style="WIDTH: 729px; HEIGHT: 381px" title="DPMud Model Diagram" alt="DPMud Model Diagram" src="http://www.the-simmons.net/images/DPMudDiagram.gif" width=729 height=381 mce_src="http://www.the-simmons.net/images/DPMudDiagram.gif"&gt;&lt;/P&gt;
&lt;P&gt;Essentially I have a many-to-many self relationship for rooms, but because I need a "payload" on that relationship (some properties on the relationship itself rather than the rooms), I chose to create another entity type called Exit and then have two 1-many relationships between Rooms and Exits--one of those relationships represents all of the exits out of a room, and the other relationship represents all of the entrances to the room.&amp;nbsp; The other parts of the model are actors which are related to rooms, and items which can be related either to a room or an actor.&amp;nbsp; The model doesn't have a good way to enforce that an item must be related either to a room or an actor but not both or neither, but I've added check constraints to the DB which handle that enforcement.&amp;nbsp; In the real game there are also events which relate to each of the other entity types as well as a large inheritance hierarchy of actor types and event types among other things, but those make the model diagram very hard to read, so I've left them out.&lt;/P&gt;
&lt;P&gt;This diagram corresponds to my CSDL file which is the XML file describing my conceptual model.&amp;nbsp; If you'd like to look that over, you can find it &lt;A title=here href="http://www.the-simmons.net/dpmud/dpmud.csdl" target=_blank mce_href="http://www.the-simmons.net/dpmud/dpmud.csdl"&gt;here&lt;/A&gt;.&amp;nbsp; Well, that CSDL file actually has a few things not present in the diagram, but&amp;nbsp;it is simplified considerably from the full model used in our game.&amp;nbsp; For completeness, you can also have a look at the &lt;A title=SSDL href="http://www.the-simmons.net/dpmud/dpmud.ssdl" target=_blank mce_href="http://www.the-simmons.net/dpmud/dpmud.ssdl"&gt;SSDL&lt;/A&gt;&amp;nbsp;and the &lt;A title=MSL href="http://www.the-simmons.net/dpmud/dpmud.msl" target=_blank mce_href="http://www.the-simmons.net/dpmud/dpmud.msl"&gt;MSL&lt;/A&gt;.&amp;nbsp; I know I'm a bit "old school" when it comes to these things&amp;nbsp;since I've been working on the EF since well before we had a designer&amp;nbsp;(funny to say that about a not-yet-released project), but I've authored each of these files by hand rather than using the designer.&amp;nbsp; I'll also point out, in case some of you are unaware, that the designer uses a file called EDMX to store all of the metadata about an EF model--this one file includes the CSDL, MSL and SSDL just in separate sections within it.&amp;nbsp; When it comes to runtime, the system requires the three separate files, and the designer projects automatically create them in your application out directory.&amp;nbsp; So, I will talk about the three files separately and even play some tricks that don't work with the designer today rather than describing the default designer experience.&lt;/P&gt;
&lt;P&gt;The one other thing I'll say about DPMud is that it was built from the beginning as rich windows client which talks direclty to the database.&amp;nbsp; So most of our initial apps will work that way.&amp;nbsp; This is nice, because these are some of the easiest apps to write, but as we go through the series we probably will also spend some time exploring other app architectures like web services and web apps.&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0in 0in 10pt; mso-margin-top-alt: auto; mso-margin-bottom-alt: auto" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Arial','sans-serif'; FONT-SIZE: 10pt; mso-fareast-font-family: 'Times New Roman'"&gt;OK.&amp;nbsp; So enough about my funny little sample.&amp;nbsp; Let's cover some EF concepts, shall we?&amp;nbsp; There are three things I'd like to talk about in this post which are all related to getting any basic app up and running (once you are done creating the metadata for the model, generating the basic entity classes, etc.):&lt;?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;OL type=1&gt;
&lt;LI style="LINE-HEIGHT: normal; MARGIN: 0in 0in 10pt; mso-margin-top-alt: auto; mso-margin-bottom-alt: auto; mso-list: l0 level1 lfo1; tab-stops: list .5in" class=MsoNormal&gt;&lt;B&gt;&lt;SPAN style="FONT-FAMILY: 'Arial','sans-serif'; FONT-SIZE: 10pt; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-size: 11.0pt"&gt;Storing your metadata in resource files.&lt;/SPAN&gt;&lt;/B&gt;&lt;SPAN style="FONT-FAMILY: 'Arial','sans-serif'; FONT-SIZE: 10pt; mso-fareast-font-family: 'Times New Roman'"&gt;&amp;nbsp; One of the things that folks often find annoying is the fact that EF applications require these three separate metadata files at runtime, and that complicates deployment, etc.&amp;nbsp; Fortunately, it's really quite easy to store these files in the assembly itself as resources and then just tell the EF to find them there.&amp;nbsp; The way to do this is to add the CSDL, MSL and SSDL files to your project and set the "Build Action" property on each one to "Embedded Resource".&amp;nbsp; Then when you specify your conneciton string, rather than explicitly listing the metadata files, you can just add "&lt;SPAN style="COLOR: #a31515"&gt;metadata=res://*/;&lt;/SPAN&gt;&lt;SPAN style="COLOR: black"&gt;" which tells the EF to look for appropriate resources in your apps statically linked assemblies any that it finds.&lt;BR style="mso-special-character: line-break"&gt;&lt;BR style="mso-special-character: line-break"&gt;&lt;/SPAN&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI style="LINE-HEIGHT: normal; MARGIN: 0in 0in 12pt; mso-margin-top-alt: auto; mso-list: l0 level1 lfo1; tab-stops: list .5in" class=MsoNormal&gt;&lt;B&gt;&lt;SPAN style="FONT-FAMILY: 'Arial','sans-serif'; FONT-SIZE: 10pt; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-size: 11.0pt"&gt;Connection strings.&lt;/SPAN&gt;&lt;/B&gt;&lt;SPAN style="FONT-FAMILY: 'Arial','sans-serif'; FONT-SIZE: 10pt; mso-fareast-font-family: 'Times New Roman'"&gt;&amp;nbsp; When you use the designer or EdmGen.exe to generate classes from your model, part of what gets generated is a strongly-typed ObjectContext which provides a convenient fa&lt;/SPAN&gt;&lt;FONT size=3 face=Calibri&gt;ç&lt;/FONT&gt;&lt;SPAN style="FONT-FAMILY: 'Arial','sans-serif'; FONT-SIZE: 10pt; mso-fareast-font-family: 'Times New Roman'"&gt;ade for working with your model.&amp;nbsp; Part of the standard pattern is that the connection string which was originally used to access the database in order to generate the model is embedded in an EntityClient connection string which is placed into the app.config file under the same name as your entity container (specified in the CSDL and used as the name of the strongly-typed ObjectContext type in the generated code).&amp;nbsp; In my sample, this name is "DPMudDB".&amp;nbsp; If the app.config file exists and has a connection string whose name matches the container, then the generated classes have a nice, parameterless constructor which will automatically pick up that connection string and use it.&lt;BR&gt;&lt;BR&gt;This mechanism is great for many scenarios--it makes for nice clean code, and it follows a great best-practice of putting the connection string out into the config file where it's easier to swap out in situations like where you might use one connection string for development, another for testing/staging and a third for final deployment.&amp;nbsp; That said, there are cases where you might want to more dynamically generate the connection string--in the case of DPMud, we have multiple database servers for different environments and wanted to provide the user with the opportunity to specify the server as well as credential information at runtime.&amp;nbsp; So, it's important to understand what the parts of the connection string are and how they go together.&amp;nbsp; &lt;BR&gt;&lt;BR&gt;If you create a connection string at runtime, then it's still quite straightforward to use.&amp;nbsp; Instead of using the parameterless constructor for the strongly-typed context, you can just use the constructor overload which takes a connection string.&amp;nbsp; This connection string is the exact same connection string that you use either with an ObjectContext (the base type or one of the strongly typed classes that inherit from it) or directly with EntityClient.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;It follows the same model as all other connection strings which is a set of name value pairs separated by semi-colons, and it has three parts:&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/LI&gt;
&lt;OL type=a&gt;
&lt;LI style="LINE-HEIGHT: normal; MARGIN: 0in 0in 12pt; mso-margin-top-alt: auto; mso-list: l0 level2 lfo1; tab-stops: list 1.0in" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Arial','sans-serif'; FONT-SIZE: 10pt; mso-fareast-font-family: 'Times New Roman'"&gt;A specification for where to find the metadata (csdl, msl &amp;amp; ssdl) which EntityClient will use for mapping between the conceptual model and the database.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;The keyword for this section is “metadata=”, and there are several different kinds of values you can give it.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;I mentioned the one I use most often above which is just to specify that the metadata lives in resources within the assembly and that the system should look through all the resources looking for appropriate ones.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;You can do this with “metadata=res://*/;”, or you can specify a pipe delimited list of directories or files (either absolute or relative to your app directory) which contain the metadata.&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI style="LINE-HEIGHT: normal; MARGIN: 0in 0in 12pt; mso-margin-top-alt: auto; mso-list: l0 level2 lfo1; tab-stops: list 1.0in" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Arial','sans-serif'; FONT-SIZE: 10pt; mso-fareast-font-family: 'Times New Roman'"&gt;The name of the database provider which EntityClient should use to actually talk to the database.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;For example, “Provider=System.Data.SqlClient;”.&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI style="LINE-HEIGHT: normal; MARGIN: 0in 0in 12pt; mso-margin-top-alt: auto; mso-list: l0 level2 lfo1; tab-stops: list 1.0in" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Arial','sans-serif'; FONT-SIZE: 10pt; mso-fareast-font-family: 'Times New Roman'"&gt;The connection string that you would use with the database provider to access your database.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;Since this value itself has a series of keywords separated by semi-colons, the string is just enclosed in double quotes. &lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&lt;/SPAN&gt;In my sample model it looks like this, “provider connection string="MultipleActiveResultSets=true;database=dpmr;server=.;Integrated Security=true;".&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;/OL&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0in 0in 12pt 0.5in; mso-margin-top-alt: auto" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Arial','sans-serif'; FONT-SIZE: 10pt; mso-fareast-font-family: 'Times New Roman'"&gt;If you are going to build up these parts dynamically, then naturally the recommended way to do so is using a connection string builder, and EntityConnectionBuilder makes this easy.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;For the provider connection string, you can of course do a similar thing using something like SqlConnectionBuilder.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;So, the whole thing together would look like this:&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0in 0in 0pt; BACKGROUND: #d9d9d9; mso-background-themecolor: background1; mso-background-themeshade: 217; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; COLOR: #2b91af; FONT-SIZE: 10pt; mso-no-proof: yes"&gt;SqlConnectionStringBuilder&lt;/SPAN&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-no-proof: yes"&gt; sqlBuilder = &lt;SPAN style="COLOR: blue"&gt;new&lt;/SPAN&gt; &lt;SPAN style="COLOR: #2b91af"&gt;SqlConnectionStringBuilder&lt;/SPAN&gt;();&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0in 0in 0pt; BACKGROUND: #d9d9d9; mso-background-themecolor: background1; mso-background-themeshade: 217; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-no-proof: yes"&gt;sqlBuilder.MultipleActiveResultSets = &lt;SPAN style="COLOR: blue"&gt;true&lt;/SPAN&gt;;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0in 0in 0pt; BACKGROUND: #d9d9d9; mso-background-themecolor: background1; mso-background-themeshade: 217; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-no-proof: yes"&gt;sqlBuilder.DataSource = &lt;SPAN style="COLOR: #a31515"&gt;"."&lt;/SPAN&gt;;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0in 0in 0pt; BACKGROUND: #d9d9d9; mso-background-themecolor: background1; mso-background-themeshade: 217; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-no-proof: yes"&gt;sqlBuilder.InitialCatalog = &lt;SPAN style="COLOR: #a31515"&gt;"dpmr"&lt;/SPAN&gt;;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0in 0in 0pt; BACKGROUND: #d9d9d9; mso-background-themecolor: background1; mso-background-themeshade: 217; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-no-proof: yes"&gt;sqlBuilder.IntegratedSecurity = &lt;SPAN style="COLOR: blue"&gt;true&lt;/SPAN&gt;;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0in 0in 0pt; BACKGROUND: #d9d9d9; mso-background-themecolor: background1; mso-background-themeshade: 217; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-no-proof: yes"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0in 0in 0pt; BACKGROUND: #d9d9d9; mso-background-themecolor: background1; mso-background-themeshade: 217; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; COLOR: #2b91af; FONT-SIZE: 10pt; mso-no-proof: yes"&gt;EntityConnectionStringBuilder&lt;/SPAN&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-no-proof: yes"&gt; entityBuilder = &lt;SPAN style="COLOR: blue"&gt;new&lt;/SPAN&gt; &lt;/SPAN&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; COLOR: #2b91af; FONT-SIZE: 10pt; mso-no-proof: yes"&gt;EntityConnectionStringBuilder&lt;/SPAN&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-no-proof: yes"&gt;();&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0in 0in 0pt; BACKGROUND: #d9d9d9; mso-background-themecolor: background1; mso-background-themeshade: 217; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-no-proof: yes"&gt;entityBuilder.ProviderConnectionString = sqlBuilder.ToString();&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0in 0in 0pt; BACKGROUND: #d9d9d9; mso-background-themecolor: background1; mso-background-themeshade: 217; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-no-proof: yes"&gt;entityBuilder.Metadata = &lt;SPAN style="COLOR: #a31515"&gt;"res://*/"&lt;/SPAN&gt;;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0in 0in 0pt; BACKGROUND: #d9d9d9; mso-background-themecolor: background1; mso-background-themeshade: 217; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-no-proof: yes"&gt;entityBuilder.Provider = &lt;SPAN style="COLOR: #a31515"&gt;"System.Data.SqlClient"&lt;/SPAN&gt;;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;OL type=1 start=3&gt;
&lt;LI style="LINE-HEIGHT: normal; MARGIN: 0in 0in 10pt; mso-margin-top-alt: auto; mso-margin-bottom-alt: auto; mso-list: l0 level1 lfo1; tab-stops: list .5in" class=MsoNormal&gt;&lt;B&gt;&lt;SPAN style="FONT-FAMILY: 'Arial','sans-serif'; FONT-SIZE: 10pt; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-size: 11.0pt"&gt;Context creation and lifetimes.&lt;/SPAN&gt;&lt;/B&gt;&lt;SPAN style="FONT-FAMILY: 'Arial','sans-serif'; FONT-SIZE: 10pt; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-size: 11.0pt; mso-bidi-font-weight: bold"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;This is a broad topic and obviously the right answer varies a lot depending on the overall architecture of the app you are building—if you are building a web service or an asp.net page then you almost certainly want the context only to stay alive during each request and then be destroyed so that your server can be as stateless as possible, but if you are building a rich client application, then your context will typically stay alive for a much longer period of time—in fact the same context probably stays alive for the life of your app.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;The reason for this is that the context performs identity resolution and provides the path from entities to the database for when you want to do things like deferred loading.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;If you destroy the context or detach the entities from it, then deferred loading won’t work.&lt;BR&gt;&lt;BR&gt;The other thing you have to remember, though, is that the EF, like most of the rest of the .Net framework, is by and large NOT thread-safe.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;So if you want to interact with the EF or your entity classes from multiple threads, then you are going to have to do your own locking.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;One simple model which works for some cases is for each thread to maintain its own context so that no locking is required.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;This means, of course, that the interactions between the threads tends to be quite limited (you can’t really pass an entity from one thread to another without being very careful), but you can do some pretty useful things even so.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;BR&gt;&lt;BR&gt;In the case of DPMud, we originally designed the system to have completely separate processes for players and for the system functions (like a process which manages all of the computer controlled AI actors in the system and another process which monitors the system and performs periodic cleanup, etc.).&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;Recently, though, we’ve begun working on some modifications to move the system processes into background threads on the clients. This makes it possible just to run a client and have it find other clients working against the database and automatically elect a process to handle the AI or whatever.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;(It also means that when it really gets going DPMud can nicely peg both cores on my dual core machine &amp;lt;grin&amp;gt;.)&lt;BR&gt;&lt;BR&gt;Happily for us, this migration to a system which uses multiple threads with a separate context on each thread was actually quite easy because some time ago we had adopted a pattern of using a static property as the entry point for accessing the context in various parts of our code.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;That way we didn’t have to pass the context around everywhere we needed it, and we could also centralize the logic for building the connection string, etc.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;I want to caution you, though, to be very careful with this kind of pattern.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;It’s critical that you think about your context lifetime, the lifetime of the objects in it, and the implication of various methods you can call on the context to be sure that this one effectively global context (at least per thread) approach is the right one for you.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;BR&gt;&lt;BR&gt;One of the biggest potential surprises is around the SaveChanges method which will save ALL changes made to entity objects attached to that context.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;So, if you have methods which modify your objects but do not immediately save (not all that unusual for many situations where you want to build up a set of changes that are part of a reasonably broad task before saving those changes all at once), and you introduce another method which makes a single change and saves (because its task is more limited and focused), then there is a risk that one of your first set of methods (just modify things but don’t save because it’s part of a bigger unit of work) could end up calling your second type of method and inadvertently saving half of your intended unit of work rather than waiting for the whole thing to complete.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;In the case of DPMud, we’re building a system which saves to the database as frequently as possible because the database is effectively a real-time communication system, so this wasn’t a problem for us.&lt;BR&gt;&lt;BR&gt;In any case, all of that was a long wind-up to sharing some code which follows the same pattern that we use in DPMud not only to consolidate connection string building, but also creating a common, static entry point to the context, and automatically maintaining a separate context for each thread by putting the context into thread-local storage.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;One other quick point: I put the static properties onto the DPMudDB (strongly typed context) partial class since it’s all about that class so why create another type for that purpose.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;BR&gt;&lt;BR&gt;Anyway, the code looks like this:&lt;/SPAN&gt;&lt;SPAN style="FONT-FAMILY: 'Arial','sans-serif'; FONT-SIZE: 10pt; mso-fareast-font-family: 'Times New Roman'"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/LI&gt;&lt;/OL&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0in 0in 0pt; BACKGROUND: #d9d9d9; mso-background-themecolor: background1; mso-background-themeshade: 217; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; COLOR: blue; FONT-SIZE: 10pt; mso-no-proof: yes"&gt;using&lt;/SPAN&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-no-proof: yes"&gt; System;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0in 0in 0pt; BACKGROUND: #d9d9d9; mso-background-themecolor: background1; mso-background-themeshade: 217; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; COLOR: blue; FONT-SIZE: 10pt; mso-no-proof: yes"&gt;using&lt;/SPAN&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-no-proof: yes"&gt; System.Data.EntityClient;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0in 0in 0pt; BACKGROUND: #d9d9d9; mso-background-themecolor: background1; mso-background-themeshade: 217; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; COLOR: blue; FONT-SIZE: 10pt; mso-no-proof: yes"&gt;using&lt;/SPAN&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-no-proof: yes"&gt; System.Data.SqlClient;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0in 0in 0pt; BACKGROUND: #d9d9d9; mso-background-themecolor: background1; mso-background-themeshade: 217; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; COLOR: blue; FONT-SIZE: 10pt; mso-no-proof: yes"&gt;using&lt;/SPAN&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-no-proof: yes"&gt; DPMud;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0in 0in 0pt; BACKGROUND: #d9d9d9; mso-background-themecolor: background1; mso-background-themeshade: 217; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-no-proof: yes"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0in 0in 0pt; BACKGROUND: #d9d9d9; mso-background-themecolor: background1; mso-background-themeshade: 217; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; COLOR: blue; FONT-SIZE: 10pt; mso-no-proof: yes"&gt;namespace&lt;/SPAN&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-no-proof: yes"&gt; DPMud&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0in 0in 0pt; BACKGROUND: #d9d9d9; mso-background-themecolor: background1; mso-background-themeshade: 217; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-no-proof: yes"&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0in 0in 0pt; BACKGROUND: #d9d9d9; mso-background-themecolor: background1; mso-background-themeshade: 217; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; COLOR: blue; FONT-SIZE: 10pt; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;public&lt;/SPAN&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-no-proof: yes"&gt; &lt;SPAN style="COLOR: blue"&gt;partial&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;class&lt;/SPAN&gt; &lt;SPAN style="COLOR: #2b91af"&gt;DPMudDB&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0in 0in 0pt; BACKGROUND: #d9d9d9; mso-background-themecolor: background1; mso-background-themeshade: 217; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0in 0in 0pt; BACKGROUND: #d9d9d9; mso-background-themecolor: background1; mso-background-themeshade: 217; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;[&lt;SPAN style="COLOR: #2b91af"&gt;ThreadStatic&lt;/SPAN&gt;]&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0in 0in 0pt; BACKGROUND: #d9d9d9; mso-background-themecolor: background1; mso-background-themeshade: 217; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;static&lt;/SPAN&gt; &lt;SPAN style="COLOR: #2b91af"&gt;DPMudDB&lt;/SPAN&gt; _db;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0in 0in 0pt; BACKGROUND: #d9d9d9; mso-background-themecolor: background1; mso-background-themeshade: 217; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-no-proof: yes"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0in 0in 0pt; BACKGROUND: #d9d9d9; mso-background-themecolor: background1; mso-background-themeshade: 217; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;static&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;string&lt;/SPAN&gt; _connectionString;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0in 0in 0pt; BACKGROUND: #d9d9d9; mso-background-themecolor: background1; mso-background-themeshade: 217; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-no-proof: yes"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0in 0in 0pt; BACKGROUND: #d9d9d9; mso-background-themecolor: background1; mso-background-themeshade: 217; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;public&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;static&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;string&lt;/SPAN&gt; ConnectionString&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0in 0in 0pt; BACKGROUND: #d9d9d9; mso-background-themecolor: background1; mso-background-themeshade: 217; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0in 0in 0pt; BACKGROUND: #d9d9d9; mso-background-themecolor: background1; mso-background-themeshade: 217; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;get&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0in 0in 0pt; BACKGROUND: #d9d9d9; mso-background-themecolor: background1; mso-background-themeshade: 217; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0in 0in 0pt; BACKGROUND: #d9d9d9; mso-background-themecolor: background1; mso-background-themeshade: 217; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;if&lt;/SPAN&gt; (_connectionString == &lt;SPAN style="COLOR: blue"&gt;null&lt;/SPAN&gt;)&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0in 0in 0pt; BACKGROUND: #d9d9d9; mso-background-themecolor: background1; mso-background-themeshade: 217; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0in 0in 0pt; BACKGROUND: white; mso-background-themecolor: background1; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;// insert code from above which uses connection string builders here //&lt;/SPAN&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0in 0in 0pt; BACKGROUND: #d9d9d9; mso-background-themecolor: background1; mso-background-themeshade: 217; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;_connectionString = entityBuilder.ToString();&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0in 0in 0pt; BACKGROUND: #d9d9d9; mso-background-themecolor: background1; mso-background-themeshade: 217; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0in 0in 0pt; BACKGROUND: #d9d9d9; mso-background-themecolor: background1; mso-background-themeshade: 217; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;return&lt;/SPAN&gt; _connectionString;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0in 0in 0pt; BACKGROUND: #d9d9d9; mso-background-themecolor: background1; mso-background-themeshade: 217; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0in 0in 0pt; BACKGROUND: #d9d9d9; mso-background-themecolor: background1; mso-background-themeshade: 217; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0in 0in 0pt; BACKGROUND: #d9d9d9; mso-background-themecolor: background1; mso-background-themeshade: 217; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-no-proof: yes"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0in 0in 0pt; BACKGROUND: #d9d9d9; mso-background-themecolor: background1; mso-background-themeshade: 217; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;public&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;static&lt;/SPAN&gt; &lt;SPAN style="COLOR: #2b91af"&gt;DPMudDB&lt;/SPAN&gt; db&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0in 0in 0pt; BACKGROUND: #d9d9d9; mso-background-themecolor: background1; mso-background-themeshade: 217; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0in 0in 0pt; BACKGROUND: #d9d9d9; mso-background-themecolor: background1; mso-background-themeshade: 217; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;get&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0in 0in 0pt; BACKGROUND: #d9d9d9; mso-background-themecolor: background1; mso-background-themeshade: 217; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0in 0in 0pt; BACKGROUND: #d9d9d9; mso-background-themecolor: background1; mso-background-themeshade: 217; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;if&lt;/SPAN&gt; ((_db == &lt;SPAN style="COLOR: blue"&gt;null&lt;/SPAN&gt;) &amp;amp;&amp;amp; (ConnectionString != &lt;SPAN style="COLOR: blue"&gt;null&lt;/SPAN&gt;))&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0in 0in 0pt; BACKGROUND: #d9d9d9; mso-background-themecolor: background1; mso-background-themeshade: 217; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0in 0in 0pt; BACKGROUND: #d9d9d9; mso-background-themecolor: background1; mso-background-themeshade: 217; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;_db = &lt;SPAN style="COLOR: blue"&gt;new&lt;/SPAN&gt; &lt;SPAN style="COLOR: #2b91af"&gt;DPMudDB&lt;/SPAN&gt;(ConnectionString);&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0in 0in 0pt; BACKGROUND: #d9d9d9; mso-background-themecolor: background1; mso-background-themeshade: 217; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0in 0in 0pt; BACKGROUND: #d9d9d9; mso-background-themecolor: background1; mso-background-themeshade: 217; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;return&lt;/SPAN&gt; _db;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0in 0in 0pt; BACKGROUND: #d9d9d9; mso-background-themecolor: background1; mso-background-themeshade: 217; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0in 0in 0pt; BACKGROUND: #d9d9d9; mso-background-themecolor: background1; mso-background-themeshade: 217; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0in 0in 0pt; BACKGROUND: #d9d9d9; mso-background-themecolor: background1; mso-background-themeshade: 217; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 10pt; BACKGROUND: #d9d9d9; mso-background-themecolor: background1; mso-background-themeshade: 217" class=MsoNormal&gt;&lt;SPAN style="LINE-HEIGHT: 115%; FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-no-proof: yes"&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0in 0in 10pt; mso-margin-top-alt: auto; mso-margin-bottom-alt: auto" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Arial','sans-serif'; FONT-SIZE: 10pt; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-size: 11.0pt; mso-bidi-font-weight: bold"&gt;So what do we get from all this?&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;Well, once we have this foundation laid, writing a program which accesses the database using our strongly typed context becomes pretty darn simple (even if we have multiple threads), and that program can itself just be a single EXE with the entire model and all of its metadata in that one assembly (this is what we do for DPMud—nothing quite like drag-and-drop deployment).&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0in 0in 10pt; mso-margin-top-alt: auto; mso-margin-bottom-alt: auto" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Arial','sans-serif'; FONT-SIZE: 10pt; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-size: 11.0pt; mso-bidi-font-weight: bold"&gt;Here’s the code for a simple program which prints out a list of all the rooms and items in the DPMud database but does so from two threads running concurrently.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;Note: you can set break points in each of the loops and step through the program seeing things interleave nicely, but if you actually run the program there’s a good chance all of the rooms will print together and the items the same because the total time required is relatively small so there may not be that much time-slicing between the threads.&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0in 0in 0pt; BACKGROUND: #d9d9d9; mso-background-themecolor: background1; mso-background-themeshade: 217; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; COLOR: blue; FONT-SIZE: 10pt; mso-no-proof: yes"&gt;using&lt;/SPAN&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-no-proof: yes"&gt; System;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0in 0in 0pt; BACKGROUND: #d9d9d9; mso-background-themecolor: background1; mso-background-themeshade: 217; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; COLOR: blue; FONT-SIZE: 10pt; mso-no-proof: yes"&gt;using&lt;/SPAN&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-no-proof: yes"&gt; System.Threading;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0in 0in 0pt; BACKGROUND: #d9d9d9; mso-background-themecolor: background1; mso-background-themeshade: 217; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; COLOR: blue; FONT-SIZE: 10pt; mso-no-proof: yes"&gt;using&lt;/SPAN&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-no-proof: yes"&gt; DPMud;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0in 0in 0pt; BACKGROUND: #d9d9d9; mso-background-themecolor: background1; mso-background-themeshade: 217; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-no-proof: yes"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0in 0in 0pt; BACKGROUND: #d9d9d9; mso-background-themecolor: background1; mso-background-themeshade: 217; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; COLOR: blue; FONT-SIZE: 10pt; mso-no-proof: yes"&gt;namespace&lt;/SPAN&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-no-proof: yes"&gt; sample1&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0in 0in 0pt; BACKGROUND: #d9d9d9; mso-background-themecolor: background1; mso-background-themeshade: 217; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-no-proof: yes"&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0in 0in 0pt; BACKGROUND: #d9d9d9; mso-background-themecolor: background1; mso-background-themeshade: 217; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;class&lt;/SPAN&gt; &lt;SPAN style="COLOR: #2b91af"&gt;Program&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0in 0in 0pt; BACKGROUND: #d9d9d9; mso-background-themecolor: background1; mso-background-themeshade: 217; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0in 0in 0pt; BACKGROUND: #d9d9d9; mso-background-themecolor: background1; mso-background-themeshade: 217; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;static&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;void&lt;/SPAN&gt; Main(&lt;SPAN style="COLOR: blue"&gt;string&lt;/SPAN&gt;[] args)&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0in 0in 0pt; BACKGROUND: #d9d9d9; mso-background-themecolor: background1; mso-background-themeshade: 217; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0in 0in 0pt; BACKGROUND: #d9d9d9; mso-background-themecolor: background1; mso-background-themeshade: 217; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;Thread&lt;/SPAN&gt; thread = &lt;SPAN style="COLOR: blue"&gt;new&lt;/SPAN&gt; &lt;SPAN style="COLOR: #2b91af"&gt;Thread&lt;/SPAN&gt;(&lt;SPAN style="COLOR: blue"&gt;new&lt;/SPAN&gt; &lt;SPAN style="COLOR: #2b91af"&gt;ThreadStart&lt;/SPAN&gt;(&lt;SPAN style="COLOR: #2b91af"&gt;Program&lt;/SPAN&gt;.PrintItems));&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0in 0in 0pt; BACKGROUND: #d9d9d9; mso-background-themecolor: background1; mso-background-themeshade: 217; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;thread.SetApartmentState(&lt;SPAN style="COLOR: #2b91af"&gt;ApartmentState&lt;/SPAN&gt;.STA);&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0in 0in 0pt; BACKGROUND: #d9d9d9; mso-background-themecolor: background1; mso-background-themeshade: 217; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;thread.Start();&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0in 0in 0pt; BACKGROUND: #d9d9d9; mso-background-themecolor: background1; mso-background-themeshade: 217; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-no-proof: yes"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0in 0in 0pt; BACKGROUND: #d9d9d9; mso-background-themecolor: background1; mso-background-themeshade: 217; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;foreach&lt;/SPAN&gt; (&lt;SPAN style="COLOR: #2b91af"&gt;Room&lt;/SPAN&gt; room &lt;SPAN style="COLOR: blue"&gt;in&lt;/SPAN&gt; &lt;SPAN style="COLOR: #2b91af"&gt;DPMudDB&lt;/SPAN&gt;.db.Rooms)&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0in 0in 0pt; BACKGROUND: #d9d9d9; mso-background-themecolor: background1; mso-background-themeshade: 217; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0in 0in 0pt; BACKGROUND: #d9d9d9; mso-background-themecolor: background1; mso-background-themeshade: 217; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;Console&lt;/SPAN&gt;.WriteLine(&lt;SPAN style="COLOR: #a31515"&gt;"Room {0}"&lt;/SPAN&gt;, room.Name);&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0in 0in 0pt; BACKGROUND: #d9d9d9; mso-background-themecolor: background1; mso-background-themeshade: 217; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0in 0in 0pt; BACKGROUND: #d9d9d9; mso-background-themecolor: background1; mso-background-themeshade: 217; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0in 0in 0pt; BACKGROUND: #d9d9d9; mso-background-themecolor: background1; mso-background-themeshade: 217; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-no-proof: yes"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0in 0in 0pt; BACKGROUND: #d9d9d9; mso-background-themecolor: background1; mso-background-themeshade: 217; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;static&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;void&lt;/SPAN&gt; PrintItems()&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0in 0in 0pt; BACKGROUND: #d9d9d9; mso-background-themecolor: background1; mso-background-themeshade: 217; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0in 0in 0pt; BACKGROUND: #d9d9d9; mso-background-themecolor: background1; mso-background-themeshade: 217; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;foreach&lt;/SPAN&gt; (&lt;SPAN style="COLOR: #2b91af"&gt;Item&lt;/SPAN&gt; item &lt;SPAN style="COLOR: blue"&gt;in&lt;/SPAN&gt; &lt;SPAN style="COLOR: #2b91af"&gt;DPMudDB&lt;/SPAN&gt;.db.Items)&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0in 0in 0pt; BACKGROUND: #d9d9d9; mso-background-themecolor: background1; mso-background-themeshade: 217; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0in 0in 0pt; BACKGROUND: #d9d9d9; mso-background-themecolor: background1; mso-background-themeshade: 217; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;Console&lt;/SPAN&gt;.WriteLine(&lt;SPAN style="COLOR: #a31515"&gt;"Item {0}"&lt;/SPAN&gt;, item.Name);&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0in 0in 0pt; BACKGROUND: #d9d9d9; mso-background-themecolor: background1; mso-background-themeshade: 217; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0in 0in 0pt; BACKGROUND: #d9d9d9; mso-background-themecolor: background1; mso-background-themeshade: 217; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0in 0in 0pt; BACKGROUND: #d9d9d9; mso-background-themecolor: background1; mso-background-themeshade: 217; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0in 0in 0pt; BACKGROUND: #d9d9d9; mso-background-themecolor: background1; mso-background-themeshade: 217; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-no-proof: yes"&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0in 0in 10pt; mso-margin-top-alt: auto; mso-margin-bottom-alt: auto" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Arial','sans-serif'; FONT-SIZE: 10pt; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-size: 11.0pt; mso-bidi-font-weight: bold"&gt;&lt;BR&gt;Fun huh?&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;OK.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;Yes I admit it, I’m a total geek, but I think it’s pretty fun.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0in 0in 10pt; mso-margin-top-alt: auto; mso-margin-bottom-alt: auto" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Arial','sans-serif'; FONT-SIZE: 10pt; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-size: 11.0pt; mso-bidi-font-weight: bold"&gt;Until next time,&lt;BR&gt;Danny&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=4937061" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/dsimmons/archive/tags/Entity+Framework/default.aspx">Entity Framework</category><category domain="http://blogs.msdn.com/dsimmons/archive/tags/ADO.Net/default.aspx">ADO.Net</category></item><item><title>August CTP of the Entity Framework released</title><link>http://blogs.msdn.com/dsimmons/archive/2007/08/28/august-ctp-of-the-entity-framework-released.aspx</link><pubDate>Tue, 28 Aug 2007 11:15:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:4607002</guid><dc:creator>dsimmons@microsoft.com</dc:creator><slash:comments>3</slash:comments><comments>http://blogs.msdn.com/dsimmons/comments/4607002.aspx</comments><wfw:commentRss>http://blogs.msdn.com/dsimmons/commentrss.aspx?PostID=4607002</wfw:commentRss><description>&lt;P&gt;Sorry for the dearth of blog posting folks, but now that the August CTP is out, it seems like I really ought to provide some more info on the features added in this CTP.&amp;nbsp; First, I'll point you to the &lt;A class="" title="official announcement" href="http://blogs.msdn.com/adonet/archive/2007/08/27/entity-framework-beta-2-the-1st-entity-framework-tools-ctp-released.aspx" mce_href="http://blogs.msdn.com/adonet/archive/2007/08/27/entity-framework-beta-2-the-1st-entity-framework-tools-ctp-released.aspx"&gt;official announcement&lt;/A&gt; which contains links to the download point for the framework, the first CTP of the designer (yeah!), the online docs and samples, etc.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;Now here's my short summary of each of the features listed in the announcement:&lt;/P&gt;&lt;SPAN style="mso-fareast-font-family: 'Times New Roman'"&gt;&lt;?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /&gt;&lt;o:p&gt;&lt;FONT face=Calibri size=3&gt;
&lt;P class=MsoListParagraph style="MARGIN: 0in 0in 0pt 0.5in; TEXT-INDENT: -0.25in; LINE-HEIGHT: normal; mso-list: l0 level1 lfo1; mso-add-space: auto"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Symbol; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol"&gt;&lt;SPAN style="mso-list: Ignore"&gt;·&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;Events to customize code generation&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 1in; LINE-HEIGHT: normal"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;Events that fire during code generation whenever types or properties are generated.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;The event handlers can be used to customize the generated code.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;Of course there are other mechanisms like partial classes which can be used to add custom logic into the classes or IPOCO which can be used to author the classes altogether by hand rather than using code gen at all, but this mechanism does provide some extensibility points for more advanced code generation scenarios.&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in; LINE-HEIGHT: normal"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoListParagraph style="MARGIN: 0in 0in 0pt 0.5in; TEXT-INDENT: -0.25in; LINE-HEIGHT: normal; mso-list: l0 level1 lfo1; mso-add-space: auto"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Symbol; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol"&gt;&lt;SPAN style="mso-list: Ignore"&gt;·&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;Abstract types in EDM models &lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 1in; LINE-HEIGHT: normal"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;As the name implies, this makes it possible to declare types in an EDM model (csdl file) which are explicitly abstract—no entity instances can be created for these types, but types can be derived from them.&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoListParagraph style="MARGIN: 0in 0in 0pt 0.5in; TEXT-INDENT: -0.25in; LINE-HEIGHT: normal; mso-list: l0 level1 lfo1; mso-add-space: auto"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Symbol; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol"&gt;&lt;SPAN style="mso-list: Ignore"&gt;·&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;Complex types &lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 1in; LINE-HEIGHT: normal"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;“Complex types” is the Entity Framework name for value properties which have more intricate structure than scalars.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;The canonical example is an Address type which contains several parts (street, city, state, etc.)&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;Complex types are somewhat like entities except that they do not have any identity of their own (they are value types).&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;This means that a complex type instance is always a part of some other enclosing entity—it can’t stand on its own, it doesn’t have relationships, etc.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;In this release, the mapping scenarios for complex types are significantly limited: inheritance is not supported, complex type properties cannot be null and they can only occur in single instances, not collections.&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 1in; LINE-HEIGHT: normal"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoListParagraph style="MARGIN: 0in 0in 0pt 0.5in; TEXT-INDENT: -0.25in; LINE-HEIGHT: normal; mso-list: l0 level1 lfo1; mso-add-space: auto"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Symbol; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol"&gt;&lt;SPAN style="mso-list: Ignore"&gt;·&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;&amp;lt;Using&amp;gt; support in metadata files &lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 1in; LINE-HEIGHT: normal"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;Models can be built from multiple separate CSDL files—somewhat like a “using” statement in a C# file which brings a namespace into the file or a #include statement in a C/C++ program except with greater validation than you get in the purely textual preprocessing of #include.&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 1in; LINE-HEIGHT: normal"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoListParagraph style="MARGIN: 0in 0in 0pt 0.5in; TEXT-INDENT: -0.25in; LINE-HEIGHT: normal; mso-list: l0 level1 lfo1; mso-add-space: auto"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Symbol; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol"&gt;&lt;SPAN style="mso-list: Ignore"&gt;·&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;Entity key serialization &lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 1in; LINE-HEIGHT: normal"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;In previous CTPs EntityKey objects were not serializable, now they are.&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 1in; LINE-HEIGHT: normal"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoListParagraph style="MARGIN: 0in 0in 0pt 0.5in; TEXT-INDENT: -0.25in; LINE-HEIGHT: normal; mso-list: l0 level1 lfo1; mso-add-space: auto"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Symbol; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol"&gt;&lt;SPAN style="mso-list: Ignore"&gt;·&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;Increased persistence ignorance in entity data classes &lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 1in; LINE-HEIGHT: normal"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;We are continuing down the path toward true POCO and persistence ignorance.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;To that end we have split the original IPOCO interface (IEntity) into two separate, more specific interfaces (IEntityWithKey and IEntityWithChangeTracker), we made IEntityWithKey optional (not implementing it has performance implications, but the scenario is supported), and many of the ObjectServices signatures have been modified to take instances of Object rather than IEntity which sets the stage for further progress here in future releases.&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 1in; LINE-HEIGHT: normal"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoListParagraph style="MARGIN: 0in 0in 0pt 0.5in; TEXT-INDENT: -0.25in; LINE-HEIGHT: normal; mso-list: l0 level1 lfo1; mso-add-space: auto"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Symbol; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol"&gt;&lt;SPAN style="mso-list: Ignore"&gt;·&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;Improved connection management in ObjectContext &lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 1in; LINE-HEIGHT: normal"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;In previous CTPs the underlying provider connection was opened when the ObjectContext was constructed and held open for the life of the context—this would create issues, for instance, with databases where licensing was based on the number of concurrently open connections since the connection might be held open for an extended period of time—even when the connection is not being used.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;The new model keeps the connection closed as much as possible while still appropriately dealing with transactions and avoiding promotion of those transactions from local to DTC where possible.&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 1in; LINE-HEIGHT: normal"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoListParagraph style="MARGIN: 0in 0in 0pt 0.5in; TEXT-INDENT: -0.25in; LINE-HEIGHT: normal; mso-list: l0 level1 lfo1; mso-add-space: auto"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Symbol; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol"&gt;&lt;SPAN style="mso-list: Ignore"&gt;·&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;Improved DataBinding usability&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 1in; LINE-HEIGHT: normal"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;Now ObjectQuery&amp;lt;T&amp;gt; and EntityCollection&amp;lt;T&amp;gt; implement IListSource which makes databinding more automatic rather than requiring explicit calls to the ToBindingList() method.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;In fact, since the automatic mechanism is so much better, ToBindingList was removed.&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 1in; LINE-HEIGHT: normal"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoListParagraph style="MARGIN: 0in 0in 0pt 0.5in; TEXT-INDENT: -0.25in; LINE-HEIGHT: normal; mso-list: l0 level1 lfo1; mso-add-space: auto"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Symbol; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol"&gt;&lt;SPAN style="mso-list: Ignore"&gt;·&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;Metadata annotations &lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 1in; LINE-HEIGHT: normal"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;CSDL files can now include custom annotations which the framework ignores but can be useful for tools or other systems built around the EDM. &lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 1in; LINE-HEIGHT: normal"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoListParagraph style="MARGIN: 0in 0in 0pt 0.5in; TEXT-INDENT: -0.25in; LINE-HEIGHT: normal; mso-list: l0 level1 lfo1; mso-add-space: auto"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Symbol; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol"&gt;&lt;SPAN style="mso-list: Ignore"&gt;·&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;Better support for span over LINQ to Entities queries &lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 1in; LINE-HEIGHT: normal"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;The span feature makes it possible to pre-fetch related entities.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;In previous CTPs span was specified through a property on ObjectQuery&amp;lt;T&amp;gt;, but in this CTP span has been changed to work as a builder method, Include, which makes it simpler to specify span rules in LINQ to Entities queries.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;Include can be called on the ObjectQuery used in the from clause of the LINQ query.&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 1in; LINE-HEIGHT: normal"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoListParagraph style="MARGIN: 0in 0in 0pt 0.5in; TEXT-INDENT: -0.25in; LINE-HEIGHT: normal; mso-list: l0 level1 lfo1; mso-add-space: auto"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Symbol; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol"&gt;&lt;SPAN style="mso-list: Ignore"&gt;·&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;Improvements to LINQ queries: additional canonical functions and automatic mapping from CLR functions to server functions &lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 1in; LINE-HEIGHT: normal"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;This means that more CLR functions are recognized and mapped to store functions in the generated SQL queries.&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 1in; LINE-HEIGHT: normal"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoListParagraph style="MARGIN: 0in 0in 0pt 0.5in; TEXT-INDENT: -0.25in; LINE-HEIGHT: normal; mso-list: l0 level1 lfo1; mso-add-space: auto"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Symbol; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol"&gt;&lt;SPAN style="mso-list: Ignore"&gt;·&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;A new event for extensibility of SaveChanges&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 1in; LINE-HEIGHT: normal"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;The OnSavingChanges event fires at the beginning of the SaveChanges method making it possible to perform validation on entities which will be saved, etc.&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 1in; LINE-HEIGHT: normal"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoListParagraph style="MARGIN: 0in 0in 0pt 0.5in; TEXT-INDENT: -0.25in; LINE-HEIGHT: normal; mso-list: l0 level1 lfo1; mso-add-space: auto"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Symbol; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol"&gt;&lt;SPAN style="mso-list: Ignore"&gt;·&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;Polymorphic results from stored procedures&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 1in; LINE-HEIGHT: normal"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;Stored procedures can that retrieve entity instances can now return polymorphic results rather than being restricted only to results of a single type.&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;The other major feature, of course, is that it works with Orcas Beta 2!&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;&lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;If you have any questions or feedback, please don't hesitate to send it along.&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;&lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;Thanks,&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;Danny&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 1in; LINE-HEIGHT: normal"&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=4607002" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/dsimmons/archive/tags/Entity+Framework/default.aspx">Entity Framework</category><category domain="http://blogs.msdn.com/dsimmons/archive/tags/ADO.Net/default.aspx">ADO.Net</category></item><item><title>"June" CTP of the Entity Framework is finally out</title><link>http://blogs.msdn.com/dsimmons/archive/2007/07/03/june-ctp-of-the-entity-framework-is-finally-out.aspx</link><pubDate>Tue, 03 Jul 2007 05:13:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:3666296</guid><dc:creator>dsimmons@microsoft.com</dc:creator><slash:comments>9</slash:comments><comments>http://blogs.msdn.com/dsimmons/comments/3666296.aspx</comments><wfw:commentRss>http://blogs.msdn.com/dsimmons/commentrss.aspx?PostID=3666296</wfw:commentRss><description>&lt;P&gt;Hey folks,&lt;/P&gt;
&lt;P&gt;It has been longer in arriving than I would have liked, but the June CTP of the Entity Framework is finally out.&amp;nbsp; This includes a HUGE set of changes.&amp;nbsp; I can't tell you how many times lately I've responded to a question on the forum or something like that with "that's fixed in the next CTP."&amp;nbsp; Finally, it's here.&amp;nbsp; Here's a partial list of the features (largely plagarized from the &lt;A class="" title="ADO.Net team blog post on the topic" href="http://blogs.msdn.com/adonet/archive/2007/07/02/ado-net-entity-framework-june-2007-ctp-now-available.aspx" mce_href="http://blogs.msdn.com/adonet/archive/2007/07/02/ado-net-entity-framework-june-2007-ctp-now-available.aspx"&gt;ADO.Net team blog post on the topic&lt;/A&gt;)&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;STRONG&gt;IPOCO&lt;/STRONG&gt; -- there's a lot more coming here to bring us closer to true POCO, but this is the first step in that direction and makes the key change to allow the creation of Entity classes that do not inherit from our base class.&lt;BR&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;STRONG&gt;ObjectContext.Detach()&lt;/STRONG&gt; -- will detach an object from the ObjectStateManager associated with an object context so that it can be attached to some other context or reclaimed by the garbage collector&lt;BR&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;STRONG&gt;Multiple entity sets per type&lt;/STRONG&gt; -- this is relatively esoteric, but it does exactly what its name says.&amp;nbsp; You can define a model which has more than one entity set with the same base type.&amp;nbsp; This is important because it enables models which work more naturally with various database models.&amp;nbsp; If you have two tables with the same schema (say "accounts" and "expired_accounts" or something), then you can define entitysets for each of them which use the same entity type rather than needing to create a different entity type which just happens to have all the same properties.&amp;nbsp; This resulted in a change to a number of the object context APIs -- strongly typed contexts, for instance, now have AddToEntitySetName methods (where EntitySetName is the actual name of each entity set).&lt;BR&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;STRONG&gt;Support for referential integrity constraints&lt;/STRONG&gt; -- This allows you to define a key to one entity type which is made up, in part, of properties which are also in the key of another entity type.&amp;nbsp; The modeling scenario in the database is where a column is both a foreign key and part of a primary key.&lt;BR&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;STRONG&gt;Span&lt;/STRONG&gt; -- this makes it possible to specify that a query not only return an entity but return some set of related entities in a single round trip and automatically hook-up the graph.&amp;nbsp; So, for instance, you could say that your customer query should also return the orders for each customer in a single round trip.&amp;nbsp; We also have an automatic query re-write feature for the object layer that enables a feature we call &lt;STRONG&gt;Relationship Span&lt;/STRONG&gt; where queries that retrieve entities will under-the-covers also return relationship information if the relationship is an EntityReference (rather than a collection).&amp;nbsp; This is usually a quick operation since typically this relationship information is co-located in the relational database as a foreign key property, and it has the very useful property that for many cases entity graphs will automatically be hooked up as long as the relevant entities on either side of the relationship have been loaded.&amp;nbsp; So, for example, if I query for a set of customers and then I separately do a query for a bunch of orders--any of those orders that are related to those customers will automatically bring along the relationship info and connect the orders up to the customers they go with.&lt;BR&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;STRONG&gt;Transactions&lt;/STRONG&gt; -- specifically integration with System.Transactions.&lt;BR&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;STRONG&gt;Serialization&lt;/STRONG&gt; -- that is, entities are automatically generated with attributes that enable binary serialization.&amp;nbsp; Unfortunately EntityKeys do not yet serialize but that will be coming in a future CTP.&lt;BR&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;STRONG&gt;No more default constructors in code-generated classes&lt;/STRONG&gt; -- I've already written about this in &lt;A class="" title="an earlier blog post" href="http://blogs.msdn.com/dsimmons/archive/2007/05/03/celebrating-the-death-of-dofinalconstruction.aspx" mce_href="http://blogs.msdn.com/dsimmons/archive/2007/05/03/celebrating-the-death-of-dofinalconstruction.aspx"&gt;an earlier blog post&lt;/A&gt;.&lt;BR&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;STRONG&gt;Improvements to stored procedure support&lt;/STRONG&gt; -- honestly I can't remember the details of this one just now, and since I'm sitting in the Denver airport where I have limited battery life on my laptop I'll delay looking it up for you.&amp;nbsp; If anyone is wondering, drop me a note and I'll get back to you.&lt;BR&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;STRONG&gt;Access to the underlying store connection&lt;/STRONG&gt; -- You can now easily access the store connection from an EntityConnection which makes it much easier to go around the covers if you need to.&amp;nbsp; (But I must say I don't have to do that nearly so often now as I used to -- this framework is actually starting to work pretty well for writing apps, IMHO &amp;lt;grin&amp;gt;.)&lt;BR&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;STRONG&gt;Directory macros &lt;/STRONG&gt;-- Makes it easier to specify where the metadata lives in&amp;nbsp;hosted scenarios&lt;BR&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;STRONG&gt;Native SQL read-only views&lt;/STRONG&gt; -- You've got to see one of the demos Tim Mallalieu runs where he shows the entity framework accessing sharepoint or some other schema that otherwise really doesn't fit the model.&lt;BR&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;STRONG&gt;UNICODE support in Entity SQL&lt;BR&gt;&lt;/STRONG&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;STRONG&gt;Query plan caching&lt;/STRONG&gt; and I'm pretty sure we do some metadata caching across app domains&amp;nbsp;as well, but that may not be fully online yet in this CTP release.&lt;BR&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;STRONG&gt;Canonical functions in Entity SQL&lt;BR&gt;&lt;/STRONG&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;STRONG&gt;Associations between sub-types&lt;/STRONG&gt; -- This one is a biggy (as if the others aren't).&amp;nbsp; Before this change, the entity types that are on the ends of relationships had to be the base type of an entityset, but after this change you can define relationships between any types in the type hierarchy even if they aren't the base types.&amp;nbsp; So, for instance, if I have a hierarchy that has Customer and BigAccountCustomer, then I could create an entity type DiscountPolicy and a relationship that only relates BigAccountCustomers to DiscountPolicies not just regular customers.&lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;I'm sure there's more in there, but that should give you a taste of things.&amp;nbsp; That's all the good news.&amp;nbsp; The bad news is that all these changes brought along with them a number of API and metadata schema changes, so if you have apps you've been working on with beta 1, a number of changes will be needed to get your apps working again with this CTP.&amp;nbsp; If your experience is anything like mine, though, the real major changes in your app will come from taking advantage of all the new features to completely remodel things with associations between subtypes and RI constraints, to use span, etc.&lt;/P&gt;
&lt;P&gt;As always, comments and feedback are more than welcome.&amp;nbsp; We're really looking forward to hearing what you think.&lt;/P&gt;
&lt;P&gt;- Danny&lt;/P&gt;
&lt;P&gt;P.S. One other small bit of bad news: Complex Types didn't make it into this CTP.&amp;nbsp; So if you are holding out for them, unfortunately you'll have to wait for the next round.&amp;nbsp; &lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=3666296" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/dsimmons/archive/tags/Entity+Framework/default.aspx">Entity Framework</category><category domain="http://blogs.msdn.com/dsimmons/archive/tags/ADO.Net/default.aspx">ADO.Net</category></item><item><title>Non-scalar Value Objects aka "Complex Types"</title><link>http://blogs.msdn.com/dsimmons/archive/2007/06/16/non-scalar-value-objects-aka-complex-types.aspx</link><pubDate>Sun, 17 Jun 2007 01:06:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:3346976</guid><dc:creator>dsimmons@microsoft.com</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.msdn.com/dsimmons/comments/3346976.aspx</comments><wfw:commentRss>http://blogs.msdn.com/dsimmons/commentrss.aspx?PostID=3346976</wfw:commentRss><description>&lt;P&gt;Yesterday there was&amp;nbsp;a &lt;A class="" title="post on the ADO.Net Orcas forum" href="http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=1738003&amp;amp;SiteID=1" mce_href="http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=1738003&amp;amp;SiteID=1"&gt;post on the ADO.Net Orcas forum&lt;/A&gt; asking if it is possible to map two entities to a single row in a single table using the entity framework.&amp;nbsp; The motivation/scenario behind this request was an entity which had an address as part of its properties plus the fact that there were other entity types which have very similar properties.&amp;nbsp; The default mapping generated by the wizard just adds these as properties of the entity, but the preferred model would be that the entity has a property which is another class that groups the address properties together.&amp;nbsp; That class would then be shared and used to model the address properties on other entity types as well.&amp;nbsp; &lt;/P&gt;
&lt;P&gt;&amp;nbsp;The initial expectation of the person asking the question was that the address should be modeled as an entity type of its own, but they ran into two problems:&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;
&lt;DIV mce_keep="true"&gt;The address type doesn't have any appropriate property (or properties) to be its key.&lt;BR&gt;&lt;/DIV&gt;&lt;/LI&gt;
&lt;LI&gt;
&lt;DIV mce_keep="true"&gt;Even if you did have appropriate properties for the key, the system doesn't let you map two entities to the same row in the same table.&lt;/DIV&gt;&lt;/LI&gt;&lt;/OL&gt;
&lt;P mce_keep="true"&gt;The moment I saw this post, I was reminded of a discussion I had with Atul Adya early on in the entity framework project when we were trying to decide whether or not to support a modelling concept we call "complex types".&amp;nbsp; Initially we had hoped not to introduce another modelling concept--aren't scalars, entities and relationships enough?&amp;nbsp; Atul's viewpoint on the matter was: "If we don't support complex types, then someday, someone is going to ask us to map two entities to the same row in the database, and we won't ever be able to support that."&amp;nbsp; Well, here we are.&amp;nbsp; At the moment the EF CTPs do not support complex types, and as a result someone has asked for the other feature Atul was referring to (two entities mapped to the same row) which we just can't support. &lt;/P&gt;
&lt;P mce_keep="true"&gt;Why can't we support two entities mapped to the same row?&amp;nbsp; Well, first off the lack of a&amp;nbsp;property or properties that can be the key is fundamental.&amp;nbsp; Secondly, if you think about it, what would insert and delete operations that affect one but not both of the entities in a row really mean?&amp;nbsp; Things get crazy really quick.&amp;nbsp; &lt;/P&gt;
&lt;P mce_keep="true"&gt;So the answer is to make sure the EDM supports the idea of complex types which Eric Evans calls value objects in his &lt;U&gt;Domain Driven Design&lt;/U&gt; book.&amp;nbsp; They have no identity on their own--their identity is slaved to the entity of which they are a part, but they do get their own class where you can add methods, validation, etc. and share it among all instances of that value type regardless of which entity they are a part of.&lt;/P&gt;
&lt;P mce_keep="true"&gt;Fortunately, we did decide to implement complex types, and they will appear in an upcoming CTP.&amp;nbsp; &lt;/P&gt;
&lt;P mce_keep="true"&gt;- Danny&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=3346976" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/dsimmons/archive/tags/Entity+Framework/default.aspx">Entity Framework</category><category domain="http://blogs.msdn.com/dsimmons/archive/tags/ADO.Net/default.aspx">ADO.Net</category><category domain="http://blogs.msdn.com/dsimmons/archive/tags/DDD/default.aspx">DDD</category></item><item><title>Persistence Ignorance: OK, I think I get it now.</title><link>http://blogs.msdn.com/dsimmons/archive/2007/06/02/persistence-ignorance-ok-i-think-i-get-it-now.aspx</link><pubDate>Sat, 02 Jun 2007 07:54:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:3037267</guid><dc:creator>dsimmons@microsoft.com</dc:creator><slash:comments>8</slash:comments><comments>http://blogs.msdn.com/dsimmons/comments/3037267.aspx</comments><wfw:commentRss>http://blogs.msdn.com/dsimmons/commentrss.aspx?PostID=3037267</wfw:commentRss><description>&lt;P&gt;Let me apologize up front for how long it has taken me to get back to &lt;A class="" title="this topic" href="http://blogs.msdn.com/dsimmons/archive/2007/03/28/a-delay-before-i-write-more-about-persistence-ignorance.aspx" target=_blank mce_href="http://blogs.msdn.com/dsimmons/archive/2007/03/28/a-delay-before-i-write-more-about-persistence-ignorance.aspx"&gt;this topic&lt;/A&gt;.&amp;nbsp; What I can say, though, is that in the intervening interval I have devoted real time to studying agile design principles and domain driven design.&lt;/P&gt;
&lt;P&gt;Initially I thought that some of the requests for *complete* persistence ignorance were the products just of dogma rather than fully informed and reasoned arguments, but when so many people give such passionate feedback it was clear that I needed to investigate more before I could claim to have any sort of an informed opinion.&amp;nbsp; The product of my research is that I am now truly convinced of the importance of complete persistence ignorance for some scenarios.&amp;nbsp; As a result, the team is now working on a series of product changes aimed at ensuring that a later move to complete persistence ignorance will not be a fundamental breaking change.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;There's no question, though, that complete persistence ignorance comes at a price--both in the performance of applications built with "pure POCO", persistence ignorant domain models and as a result in the complexity of the entity framework which enables them.&amp;nbsp; The additional complexity of the framework is not just about enabling such applications to function but a product of the fact that the performance degradation which results means that the framework must support a spectrum of flexible options between complete persistence ignorance on one hand and prescriptive architectures which build some persistence information into the domain model to improve performance on the other hand.&lt;/P&gt;
&lt;P&gt;To make this more concrete, we have identified 4 elements of the existing entity framework design which block persistence ignorance.&amp;nbsp; That is, 4 ways in which entities are currently required to have knowledge of the framework:&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;They must store a copy of an EntityKey.&lt;/LI&gt;
&lt;LI&gt;They must provide change tracking notifications through a prescriptive interface.&lt;/LI&gt;
&lt;LI&gt;They must be decorated with a series of attributes which provide additional metadata.&lt;/LI&gt;
&lt;LI&gt;If they participate in relationships, the requirements are even more stringent as indicated by the requirement to implement the interface&amp;nbsp;IEntityWithRelationships.&lt;/LI&gt;&lt;/OL&gt;
&lt;P&gt;The first two requirements are enforced with the IEntity interface and must be addressed if we are to enable persistence ignorance at any point in the future.&amp;nbsp; In fact a series of key object services APIs currently .&amp;nbsp; At the same time each of these has significant performance implications.&amp;nbsp; Choosing not to store EntityKeys on the entities, for instance, means that navigating from an entity to the ObjectStateEntry&amp;nbsp;which matches it either requires a brute-force search of the ObjectStateManager or for the ObjectStateManager to maintain a dictionary mapping from CLR reference to ObjectStateEntry which is a significnat expense.&amp;nbsp; Not supporting the change tracking mechanism means that the ObjectStateManager must cache a copy of the original values for each entity (all original values and they must be cache whether or not the entity is modified).&lt;/P&gt;
&lt;P&gt;While I do believe that there are circumstances in which the loss of performance is a reasonable tradeoff for persistence ignorance, I also believe that for a great many applications, even where persistence ignorance is highly valued, there will come a time in the performance tuning process when one or another of these two compromises must be made.&amp;nbsp; As a result, we are working on replacing IEntity with two separate interfaces and making both of them optional--which means the object services API signatures will change from taking parameters of type IEntity to type "object" and the framework must support multiple mechanisms for each of these.&lt;/P&gt;
&lt;P&gt;The 3rd and 4th issues are, on the one hand, harder to correct, but on the other hand things which can be corrected later.&amp;nbsp; At some point we will add an alternative mechanism for specifying metadata about the entity objects (thus freeing us from the hard requirement for attributes).&amp;nbsp; Similarly, we can envision ways to enable POCO collection and reference mechanisms for relationships which can be added later as a complement to the existing prescriptive EntityCollection&amp;lt;T&amp;gt;, EntityReference&amp;lt;T&amp;gt; and RelationshipManager classes.&lt;/P&gt;
&lt;P&gt;So, to sum it all up, message received: persistance ignorance is needed, and we're now working to deliver it.&amp;nbsp; The first release of the entity framework likely will not have full support for it (there's just not enough time), but we will work to get into the first release the key changes which could not be made later so that the stage is set for the next release.&lt;/P&gt;
&lt;P&gt;- Danny&lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=3037267" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/dsimmons/archive/tags/Entity+Framework/default.aspx">Entity Framework</category><category domain="http://blogs.msdn.com/dsimmons/archive/tags/ADO.Net/default.aspx">ADO.Net</category><category domain="http://blogs.msdn.com/dsimmons/archive/tags/DDD/default.aspx">DDD</category><category domain="http://blogs.msdn.com/dsimmons/archive/tags/Agile/default.aspx">Agile</category></item><item><title>Where’s the model?  Is it the code or something else?</title><link>http://blogs.msdn.com/dsimmons/archive/2007/05/04/where-s-the-model-is-it-the-code-or-something-else.aspx</link><pubDate>Fri, 04 May 2007 09:24:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:2388351</guid><dc:creator>dsimmons@microsoft.com</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.msdn.com/dsimmons/comments/2388351.aspx</comments><wfw:commentRss>http://blogs.msdn.com/dsimmons/commentrss.aspx?PostID=2388351</wfw:commentRss><description>&lt;P&gt;&lt;SPAN style="FONT-SIZE: 11pt; FONT-FAMILY: 'Calibri','sans-serif'; mso-ascii-theme-font: minor-latin; mso-hansi-theme-font: minor-latin"&gt;A few weeks ago I had a very interesting email exchange with &lt;A href="http://codebetter.com/blogs/jeffrey.palermo/"&gt;Jeffrey Palermo&lt;/A&gt; in which he raised some important questions about the Entity Framework.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;Here’s an excerpt from his original query (used by permission):&lt;?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN-LEFT: 0.5in"&gt;&lt;I style="mso-bidi-font-style: normal"&gt;&lt;SPAN style="FONT-SIZE: 11pt; FONT-FAMILY: 'Calibri','sans-serif'; mso-ascii-theme-font: minor-latin; mso-hansi-theme-font: minor-latin"&gt;I've been thinking a lot about the model of the problem domain for a piece of software and the question of "what is the model".&amp;nbsp; In domain driven design, the domain model in code is the canonical representation of the thoughts and concepts of the business domain (the model).&amp;nbsp; Even so, the code is a very good _representation_ or _translation_ of the model as discussed by business analysts (it encorporates the concepts (entities) and behavior and rules of the business domain).&amp;nbsp; The database schema is another translation of this model, but only geared toward storage of the concepts or entities.&amp;nbsp; The behavior is absent here, just storage (for the most part).&amp;nbsp; &lt;BR&gt;&lt;BR&gt;This new EDM concept your team is introducing seems to be aimed at being the new canonical representation of the model.&amp;nbsp; Here, there is an Xml file which describes the model or _represents_ the model, but is not the model itself.&amp;nbsp; I remember when UML was really big, and folks were calling that the model.&amp;nbsp; It could be described so well that it was called the model and all else was secondary.&amp;nbsp; In the end, the UML wasn't executable, wasn't verifyable and wasn't testable, so it lost mindshare because when it came to working software that handled the business domain correctly, it still didn't deliver.&amp;nbsp; There were tools that sought to generate software from the UML, but again, it didn't work. &lt;BR&gt;&lt;BR&gt;I'm having a problem with your EDM xml file because I respect history.&amp;nbsp; The Xml file that represents the model:&amp;nbsp; how do we test it?&amp;nbsp; How do I _know_ that it's correct?&amp;nbsp; that is contains the right concepts (entities)?&amp;nbsp; that every bit of it's behavior is correct?&amp;nbsp; That every one of its rules is right? &lt;BR&gt;&lt;BR&gt;I respect the coded domain model so much because it can't lie to me.&amp;nbsp; I run my unit tests, and they pass or fail.&amp;nbsp; I can demonstrate it.&amp;nbsp; I can objectively prove its behavior and rules.&amp;nbsp; The best representation of the model has to work 100%. &lt;BR&gt;&lt;BR&gt;Maybe you've thought about this and have an answer.&amp;nbsp; I've heard said that this new Xml artifact will be called "the model".&amp;nbsp; Is that really the intended noun?&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/I&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="FONT-SIZE: 11pt; FONT-FAMILY: 'Calibri','sans-serif'; mso-ascii-theme-font: minor-latin; mso-hansi-theme-font: minor-latin"&gt;My response was that I hear and share concerns about the parallels to UML and the failed efforts of the past to make UML the center of the universe.&amp;nbsp; (I personally think codegen from UML is so evil that I have taken to calling UML "the enemy" not because it's original purpose and ideas are bad—it can be a great tool for doing some sketches to communicate some ideas—but because it has been perverted to evil ends.)&lt;/SPAN&gt;&lt;SPAN style="FONT-FAMILY: 'Calibri','sans-serif'; mso-ascii-theme-font: minor-latin; mso-hansi-theme-font: minor-latin"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="FONT-SIZE: 11pt; FONT-FAMILY: 'Calibri','sans-serif'; mso-ascii-theme-font: minor-latin; mso-hansi-theme-font: minor-latin"&gt;We do talk about the EDM for an application as "the model", but that's just a verbal short-hand for "data model", which I believe is a critical distinction.&amp;nbsp; We are explicitly NOT trying to define behavior in the EDM.&amp;nbsp; The code is the right way to define that.&amp;nbsp; We are, however, trying to define enough about the structure and constraints on the data that we can provide a rich set of services in a general fashion that still honor those constraints.&amp;nbsp; If you think about it, this is very much like what the relational model does today vs. just doing your own file format.&amp;nbsp; The relational model allows you to describe some things about the structure of your data so that the database and other parts of the system can provide services which help you manage that data.&amp;nbsp; The idea of the EDM is to provide a higher-level of abstraction that gives more information about the structure of the data so that we can provide more services.&amp;nbsp; This doesn't replace the object model or reduce its critical role; it just augments it with new services.&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="FONT-SIZE: 11pt; FONT-FAMILY: 'Calibri','sans-serif'; mso-ascii-theme-font: minor-latin; mso-hansi-theme-font: minor-latin"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&lt;/SPAN&gt;Once we start generating code from the EDM, things definitely become blurred a bit, but the explicit goal of the generated code is not to replace your object model—it's to save you some typing of repetitive things when you are building that object model.&amp;nbsp; Further, the intent is that we would not require this generated code—you can always build your model completely on your own and just align the EDM with the shape of that model so that you can take advantage of the EDM-enabled services we provide (right now that means persistence/query, but eventually that means other things like reporting, replication, remoting, etc.).&lt;/SPAN&gt;&lt;SPAN style="FONT-FAMILY: 'Calibri','sans-serif'; mso-ascii-theme-font: minor-latin; mso-hansi-theme-font: minor-latin"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;o:p&gt;&lt;FONT face="Times New Roman" size=3&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=2388351" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/dsimmons/archive/tags/Entity+Framework/default.aspx">Entity Framework</category><category domain="http://blogs.msdn.com/dsimmons/archive/tags/ADO.Net/default.aspx">ADO.Net</category><category domain="http://blogs.msdn.com/dsimmons/archive/tags/DDD/default.aspx">DDD</category></item></channel></rss>