<?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>Dariusz quatscht : Entity Framework</title><link>http://blogs.msdn.com/dparys/archive/tags/Entity+Framework/default.aspx</link><description>Tags: Entity Framework</description><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>TechTalk Dezember 2009: Anwendungsentwicklung mit Visual Studio 2010</title><link>http://blogs.msdn.com/dparys/archive/2009/07/31/techtalk-dezember-2009-anwendungsentwicklung-mit-visual-studio-2010.aspx</link><pubDate>Fri, 31 Jul 2009 12:05:52 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9854259</guid><dc:creator>dparys</dc:creator><slash:comments>6</slash:comments><comments>http://blogs.msdn.com/dparys/comments/9854259.aspx</comments><wfw:commentRss>http://blogs.msdn.com/dparys/commentrss.aspx?PostID=9854259</wfw:commentRss><wfw:comment>http://blogs.msdn.com/dparys/rsscomments.aspx?PostID=9854259</wfw:comment><description>&lt;p&gt;Erst im Juni habe ich einen TechTalk hinter mir und schon steht mein nächster an. Dieses mal jedoch nicht über einen Monat gezogen sondern in einer Woche werden 5 Städte besucht und mein Kollege &lt;a href="http://blogs.msdn.com/cbinder"&gt;Christian Binder&lt;/a&gt; wird auch mit von der Partie sein.&lt;/p&gt;  &lt;p&gt;In Visual Studio 2010 kommen so viele neue Elemente dazu das wir einfach in &lt;a href="http://www.microsoft.com/germany/msdn/techtalk/aktuell/default.mspx"&gt;diesem TechTalk&lt;/a&gt; verschiedene Aspekte live im Coding demonstrieren wollen und auf hoffentlich viele Fragen eingehen dürfen. Ganz nach dem Motto: “Keine Slides! Nur Code!”&lt;/p&gt;  &lt;p&gt;Hier der Auszug von der MSDN TechTalk Anmeldeseite:&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;em&gt;Der letzte MSDN TechTalk in diesem Jahr nimmt Sie mit auf eine Reise zur nächsten Version von Visual Studio: Visual Studio 2010. Dabei werden Christian Binder und Dariusz Parys die interessantesten Aspekte der neuen Entwicklungsumgebung vorstellen: von Verbesserungen in den einzelnen Frameworks bis hin zu neuen Möglichkeiten in den Application Lifecycle Management Tools, die das Testen und die Entwicklung im Team einfacher machen, wird dieser TechTalk die verschiedenen Aspekte mit Hilfe von Live Codings demonstrieren. Das heißt ganz klar: Keine Slides! Nur Code!&lt;/em&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;blockquote&gt;   &lt;h4&gt;Die Termine:&lt;/h4&gt; &lt;/blockquote&gt;  &lt;ul&gt;   &lt;ul&gt;     &lt;li&gt;&lt;a href="http://msevents.microsoft.com/CUI/EventDetail.aspx?EventID=1032422667&amp;amp;Culture=de-DE"&gt;30.11. Karlsruhe&lt;/a&gt;&lt;/li&gt;      &lt;li&gt;&lt;a href="http://msevents.microsoft.com/CUI/EventDetail.aspx?EventID=1032422668&amp;amp;Culture=de-DE"&gt;01.12. Köln&lt;/a&gt;&lt;/li&gt;      &lt;li&gt;&lt;a href="http://msevents.microsoft.com/CUI/EventDetail.aspx?EventID=1032422669&amp;amp;Culture=de-DE"&gt;02.12. Hamburg&lt;/a&gt;&lt;/li&gt;      &lt;li&gt;&lt;a href="http://msevents.microsoft.com/CUI/EventDetail.aspx?EventID=1032422671&amp;amp;Culture=de-DE"&gt;03.12. Berlin&lt;/a&gt;&lt;/li&gt;      &lt;li&gt;&lt;a href="http://msevents.microsoft.com/CUI/EventDetail.aspx?EventID=1032422672&amp;amp;Culture=de-DE"&gt;04.12. München&lt;/a&gt;&lt;/li&gt;   &lt;/ul&gt; &lt;/ul&gt;  &lt;p&gt;An manchen Terminen werden wir vermutlich deutlich überziehen, das dürfte Karlsruhe, Berlin und München sein. In Köln und Hamburg sind wir leider an die Öffnungszeiten des Microsoft Office gebunden.&lt;/p&gt;  &lt;p&gt;Ich freue mich schon auf viele Teilnehmer und Fragen, bis dann!&lt;/p&gt;  &lt;p&gt;Link: &lt;a href="http://www.microsoft.com/germany/msdn/techtalk/aktuell/default.mspx"&gt;Offizielle TechTalk Anmeldeseite&lt;/a&gt;&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9854259" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/dparys/archive/tags/Connected+Systems/default.aspx">Connected Systems</category><category domain="http://blogs.msdn.com/dparys/archive/tags/Visual+Studio/default.aspx">Visual Studio</category><category domain="http://blogs.msdn.com/dparys/archive/tags/C_2B002B002F00_CLI/default.aspx">C++/CLI</category><category domain="http://blogs.msdn.com/dparys/archive/tags/WCF/default.aspx">WCF</category><category domain="http://blogs.msdn.com/dparys/archive/tags/WF/default.aspx">WF</category><category domain="http://blogs.msdn.com/dparys/archive/tags/VSTS_2F00_TFS/default.aspx">VSTS/TFS</category><category domain="http://blogs.msdn.com/dparys/archive/tags/C_2300_/default.aspx">C#</category><category domain="http://blogs.msdn.com/dparys/archive/tags/Coding4Fun/default.aspx">Coding4Fun</category><category domain="http://blogs.msdn.com/dparys/archive/tags/ASP.NET/default.aspx">ASP.NET</category><category domain="http://blogs.msdn.com/dparys/archive/tags/Silverlight/default.aspx">Silverlight</category><category domain="http://blogs.msdn.com/dparys/archive/tags/Security/default.aspx">Security</category><category domain="http://blogs.msdn.com/dparys/archive/tags/MSDN/default.aspx">MSDN</category><category domain="http://blogs.msdn.com/dparys/archive/tags/VSTS/default.aspx">VSTS</category><category domain="http://blogs.msdn.com/dparys/archive/tags/Events/default.aspx">Events</category><category domain="http://blogs.msdn.com/dparys/archive/tags/TechTalk/default.aspx">TechTalk</category><category domain="http://blogs.msdn.com/dparys/archive/tags/.NET+Framework/default.aspx">.NET Framework</category><category domain="http://blogs.msdn.com/dparys/archive/tags/Testing/default.aspx">Testing</category><category domain="http://blogs.msdn.com/dparys/archive/tags/PLINQ/default.aspx">PLINQ</category><category domain="http://blogs.msdn.com/dparys/archive/tags/Tools/default.aspx">Tools</category><category domain="http://blogs.msdn.com/dparys/archive/tags/Data+Access/default.aspx">Data Access</category><category domain="http://blogs.msdn.com/dparys/archive/tags/C_2B002B00_/default.aspx">C++</category><category domain="http://blogs.msdn.com/dparys/archive/tags/Services/default.aspx">Services</category><category domain="http://blogs.msdn.com/dparys/archive/tags/Dynamic+Languages/default.aspx">Dynamic Languages</category><category domain="http://blogs.msdn.com/dparys/archive/tags/LINQ/default.aspx">LINQ</category><category domain="http://blogs.msdn.com/dparys/archive/tags/Parallel+Computing/default.aspx">Parallel Computing</category><category domain="http://blogs.msdn.com/dparys/archive/tags/WPF/default.aspx">WPF</category><category domain="http://blogs.msdn.com/dparys/archive/tags/Entity+Framework/default.aspx">Entity Framework</category><category domain="http://blogs.msdn.com/dparys/archive/tags/Community/default.aspx">Community</category><category domain="http://blogs.msdn.com/dparys/archive/tags/Coding/default.aspx">Coding</category><category domain="http://blogs.msdn.com/dparys/archive/tags/Visual+Studio+2010/default.aspx">Visual Studio 2010</category></item><item><title>Tech-Ed 2009 vom 09.11 – 13.11 in Berlin</title><link>http://blogs.msdn.com/dparys/archive/2009/06/22/tech-ed-2009-vom-09-11-13-11-in-berlin.aspx</link><pubDate>Mon, 22 Jun 2009 17:54:21 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9797738</guid><dc:creator>dparys</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.msdn.com/dparys/comments/9797738.aspx</comments><wfw:commentRss>http://blogs.msdn.com/dparys/commentrss.aspx?PostID=9797738</wfw:commentRss><wfw:comment>http://blogs.msdn.com/dparys/rsscomments.aspx?PostID=9797738</wfw:comment><description>&lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/dparys/WindowsLiveWriter/TechEd2009vom09.1113.11inBerlin_EDB7/banner-home1_2.jpg"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="banner-home1" border="0" alt="banner-home1" src="http://blogs.msdn.com/blogfiles/dparys/WindowsLiveWriter/TechEd2009vom09.1113.11inBerlin_EDB7/banner-home1_thumb.jpg" width="729" height="221" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Nach langer Pause dürfen wir die Tech-Ed endlich wieder in Deutschland begrüßen. Dieses Mal ist Berlin Gastgeber. Es werden zahlreiche neue Technologien vorgestellt und nach Jahrelanger Trennung von IT-Pros und Developern wieder ein einwöchiger Event für beide veranstaltet. Themen werden unter anderem Windows 7, Windows Server 2008 R2, Windows Azure und Visual Studio 2010 sein.&lt;/p&gt;  &lt;p&gt;Frühbucherrabatte gibt es auf der entsprechenden Webseite&lt;/p&gt;  &lt;p&gt;&lt;a title="http://www.microsoft.com/europe/teched/" href="http://www.microsoft.com/europe/teched/"&gt;http://www.microsoft.com/europe/teched/&lt;/a&gt;&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9797738" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/dparys/archive/tags/WCF/default.aspx">WCF</category><category domain="http://blogs.msdn.com/dparys/archive/tags/WF/default.aspx">WF</category><category domain="http://blogs.msdn.com/dparys/archive/tags/VSTS_2F00_TFS/default.aspx">VSTS/TFS</category><category domain="http://blogs.msdn.com/dparys/archive/tags/Dev+Tools/default.aspx">Dev Tools</category><category domain="http://blogs.msdn.com/dparys/archive/tags/C_2300_/default.aspx">C#</category><category domain="http://blogs.msdn.com/dparys/archive/tags/Conference/default.aspx">Conference</category><category domain="http://blogs.msdn.com/dparys/archive/tags/ASP.NET/default.aspx">ASP.NET</category><category domain="http://blogs.msdn.com/dparys/archive/tags/Silverlight/default.aspx">Silverlight</category><category domain="http://blogs.msdn.com/dparys/archive/tags/Windows+Server/default.aspx">Windows Server</category><category domain="http://blogs.msdn.com/dparys/archive/tags/VSTS/default.aspx">VSTS</category><category domain="http://blogs.msdn.com/dparys/archive/tags/Events/default.aspx">Events</category><category domain="http://blogs.msdn.com/dparys/archive/tags/Windows+Live/default.aspx">Windows Live</category><category domain="http://blogs.msdn.com/dparys/archive/tags/.NET+Framework/default.aspx">.NET Framework</category><category domain="http://blogs.msdn.com/dparys/archive/tags/Testing/default.aspx">Testing</category><category domain="http://blogs.msdn.com/dparys/archive/tags/PLINQ/default.aspx">PLINQ</category><category domain="http://blogs.msdn.com/dparys/archive/tags/Data+Access/default.aspx">Data Access</category><category domain="http://blogs.msdn.com/dparys/archive/tags/C_2B002B00_/default.aspx">C++</category><category domain="http://blogs.msdn.com/dparys/archive/tags/Services/default.aspx">Services</category><category domain="http://blogs.msdn.com/dparys/archive/tags/Virtualization/default.aspx">Virtualization</category><category domain="http://blogs.msdn.com/dparys/archive/tags/Architecture/default.aspx">Architecture</category><category domain="http://blogs.msdn.com/dparys/archive/tags/Dynamic+Languages/default.aspx">Dynamic Languages</category><category domain="http://blogs.msdn.com/dparys/archive/tags/Parallel+Computing/default.aspx">Parallel Computing</category><category domain="http://blogs.msdn.com/dparys/archive/tags/WPF/default.aspx">WPF</category><category domain="http://blogs.msdn.com/dparys/archive/tags/Entity+Framework/default.aspx">Entity Framework</category><category domain="http://blogs.msdn.com/dparys/archive/tags/Windows+Azure/default.aspx">Windows Azure</category><category domain="http://blogs.msdn.com/dparys/archive/tags/.NET+Services/default.aspx">.NET Services</category><category domain="http://blogs.msdn.com/dparys/archive/tags/Azure+Services/default.aspx">Azure Services</category><category domain="http://blogs.msdn.com/dparys/archive/tags/Live+Services/default.aspx">Live Services</category><category domain="http://blogs.msdn.com/dparys/archive/tags/Community/default.aspx">Community</category><category domain="http://blogs.msdn.com/dparys/archive/tags/Windows+7/default.aspx">Windows 7</category><category domain="http://blogs.msdn.com/dparys/archive/tags/Visual+Studio+2010/default.aspx">Visual Studio 2010</category></item><item><title>Projekt Blog Poll – Entity Framework Revisited und die Folgen bisher</title><link>http://blogs.msdn.com/dparys/archive/2009/06/15/projekt-blog-poll-entity-framework-revisited-und-die-folgen-bisher.aspx</link><pubDate>Mon, 15 Jun 2009 11:23:27 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9752395</guid><dc:creator>dparys</dc:creator><slash:comments>5</slash:comments><comments>http://blogs.msdn.com/dparys/comments/9752395.aspx</comments><wfw:commentRss>http://blogs.msdn.com/dparys/commentrss.aspx?PostID=9752395</wfw:commentRss><wfw:comment>http://blogs.msdn.com/dparys/rsscomments.aspx?PostID=9752395</wfw:comment><description>&lt;p&gt;Das Projekt Blog Poll ist nun wieder beim Entity Framework angekommen. Dieses mal werden die Entitäten auf die eigenen Objekte gemapped. Jetzt werden sich vermutlich einige Leute fragen, warum mappe ich auf eigene Objekte? Dann lässt sich doch das ADO.NET Data Services Framework nicht so einfach nutzen. Bei einem eigenen Objekt Modell muss man zusätzliche Schnittstellen implementieren! Stimmt. Aber ich werde im folgenden Projekt die ADO.NET Data Services auch nicht final benutzen. Ich habe in meinem Test Prototypen ein Problem festgestellt das ich noch nicht so hundertprozentig eingrenzen konnte. Das Problem ist beim Hosten von Silverlight Anwendungen über Cross-Domain Grenzen mit dem Zugriff auf die ADO.NET Data Services. Der Datenzugriff funktioniert in dem Szenario nicht so wie er soll. Insofern werde ich das Repository durch eine WCF Service Schicht kapseln, diese hat kein Probleme mit der Cross-Domain Verteilung der Anwendung. &lt;/p&gt;  &lt;p&gt;Für alle die, die noch nicht so richtig ins Projekt reingeschaut haben, gibt es hier nochmal die komplette Serie verlinkt.&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;a href="http://blogs.msdn.com/dparys/archive/2009/05/14/projekt-blog-poll-anforderungen.aspx"&gt;Projekt Blog Poll – Anforderungen (Teil 1)&lt;/a&gt;&lt;/p&gt;    &lt;p&gt;&lt;a href="http://blogs.msdn.com/dparys/archive/2009/05/15/projekt-blog-poll-technisches-design.aspx"&gt;Projekt Blog Poll – Technisches Design (Teil 2)&lt;/a&gt;&lt;/p&gt;    &lt;p&gt;&lt;a href="http://blogs.msdn.com/dparys/archive/2009/05/20/projekt-blog-poll-datenbankschema.aspx"&gt;Projekt Blog Poll – Datenbankschema (Teil 3)&lt;/a&gt;&lt;/p&gt;    &lt;p&gt;&lt;a href="http://blogs.msdn.com/dparys/archive/2009/05/25/projekt-blog-poll-entity-framework-repository.aspx"&gt;Projekt Blog Poll – Entity Framework Repository (Teil 4)&lt;/a&gt;&lt;/p&gt;    &lt;p&gt;&lt;a href="http://blogs.msdn.com/dparys/archive/2009/05/27/projekt-blog-poll-domain-model.aspx"&gt;Projekt Blog Poll – Domain Model (Teil 5)&lt;/a&gt;&lt;/p&gt;    &lt;p&gt;&lt;a href="http://blogs.msdn.com/dparys/archive/2009/06/08/mein-blog-und-das-projekt-blog-poll-und-widescreen.aspx"&gt;Projekt Blog Poll – Specification (Teil 6)&lt;/a&gt;&lt;/p&gt;    &lt;p&gt;&lt;a href="http://blogs.msdn.com/dparys/archive/2009/06/15/projekt-blog-poll-mock-repository.aspx"&gt;Projekt Blog Poll – Mock Repository (Teil 7)&lt;/a&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;So, viel Spaß beim 8. Teil.&lt;/p&gt; &lt;object data="data:application/x-silverlight-2," type="application/x-silverlight-2" width="320" height="240"&gt; &lt;param name="source" value="http://channel9.msdn.com/App_Themes/default/vp09_06_09.xap" /&gt; &lt;param name="initParams" value="m=http://mschnlnine.vo.llnwd.net/d1/ch9/4/4/1/6/6/4/pbpteil8_2MB_ch9.wmv,autostart=false,autohide=true,showembed=true, thumbnail=http://mschnlnine.vo.llnwd.net/d1/ch9/4/4/1/6/6/4/pbpteil8_large_ch9.png, postid=466144" /&gt; &lt;param name="background" value="#00FFFFFF" /&gt; &lt;a href="http://go.microsoft.com/fwlink/?LinkID=124807" style="text-decoration: none;"&gt; &lt;img src="http://go.microsoft.com/fwlink/?LinkId=108181" alt="Get Microsoft Silverlight" style="border-style: none" /&gt; &lt;/a&gt; &lt;/object&gt;  &lt;p&gt;Update: Jetzt müsste das Video auch in besserer Qualität zu sehen sein.&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9752395" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/dparys/archive/tags/C_2300_/default.aspx">C#</category><category domain="http://blogs.msdn.com/dparys/archive/tags/Coding4Fun/default.aspx">Coding4Fun</category><category domain="http://blogs.msdn.com/dparys/archive/tags/Silverlight/default.aspx">Silverlight</category><category domain="http://blogs.msdn.com/dparys/archive/tags/Architecture/default.aspx">Architecture</category><category domain="http://blogs.msdn.com/dparys/archive/tags/Entity+Framework/default.aspx">Entity Framework</category><category domain="http://blogs.msdn.com/dparys/archive/tags/Coding/default.aspx">Coding</category></item><item><title>Empfehlung: Entity Framework Learning Guide von Zeeshan Hirani</title><link>http://blogs.msdn.com/dparys/archive/2009/04/08/empfehlung-entity-framework-learning-guide-von-zeeshan-hirani.aspx</link><pubDate>Wed, 08 Apr 2009 19:16:09 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9538482</guid><dc:creator>dparys</dc:creator><slash:comments>2</slash:comments><comments>http://blogs.msdn.com/dparys/comments/9538482.aspx</comments><wfw:commentRss>http://blogs.msdn.com/dparys/commentrss.aspx?PostID=9538482</wfw:commentRss><wfw:comment>http://blogs.msdn.com/dparys/rsscomments.aspx?PostID=9538482</wfw:comment><description>&lt;p&gt;Zeeshan Hirani hat einen Umfangreichen Learning Guide zum ADO.NET Entity Framework geschrieben. Auf knapp 500 Seiten gibt es Problemstellungen und die passenden Lösungen dazu. Durch den Aufbau kann man im Inhaltsverzeichnis das Thema rauspicken das einen Interessiert und seperat die Problemstellung und Lösung nachvollziehen. Dazu gibt es auch noch ein komplettes Beispielprojekt. Der Guide selbst wurde schon im Dezember veröffentlicht, jedoch bin ich erst vor kurzem darauf hingewiesen worden und wolllte das auch gleich in meinem Blog weitergeben.&lt;/p&gt;  &lt;p&gt;Blog Post: &lt;a href="http://weblogs.asp.net/zeeshanhirani/archive/2008/12/18/my-christmas-present-to-the-entity-framework-community.aspx"&gt;Contributions to Entity Framework Community&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;PDF: &lt;a href="http://cid-245ed00edb4c374e.skydrive.live.com/self.aspx/Public/entity%20framework%20learning%20guide.pdf"&gt;Entity Learning Guide&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Samples: &lt;a href="http://cid-245ed00edb4c374e.skydrive.live.com/self.aspx/Public/completeproject.zip"&gt;Complete Project with Databases&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&lt;a href="http://weblogs.asp.net/zeeshanhirani/default.aspx"&gt;Zeeshan&lt;/a&gt;, Thank you for this contribution!&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9538482" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/dparys/archive/tags/Data+Access/default.aspx">Data Access</category><category domain="http://blogs.msdn.com/dparys/archive/tags/Entity+Framework/default.aspx">Entity Framework</category><category domain="http://blogs.msdn.com/dparys/archive/tags/Community/default.aspx">Community</category></item><item><title>Improving Entity Framework Performance</title><link>http://blogs.msdn.com/dparys/archive/2009/04/06/improving-entity-framework-performance.aspx</link><pubDate>Mon, 06 Apr 2009 10:48:20 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9533322</guid><dc:creator>dparys</dc:creator><slash:comments>9</slash:comments><comments>http://blogs.msdn.com/dparys/comments/9533322.aspx</comments><wfw:commentRss>http://blogs.msdn.com/dparys/commentrss.aspx?PostID=9533322</wfw:commentRss><wfw:comment>http://blogs.msdn.com/dparys/rsscomments.aspx?PostID=9533322</wfw:comment><description>&lt;p&gt;I was really shocked when I saw this blog post: &lt;a href="http://toomanylayers.blogspot.com/2009/01/entity-framework-and-linq-to-sql.html"&gt;Entity Framework and LINQ to SQL Performance&lt;/a&gt;. I decided to download the performance test solution and try the tests myself. I did not changed any of the tests so far, I just added for my own interest NHibernate into the game as I think that it is the choice of Frameworks for Domain Driven Design.&lt;/p&gt;  &lt;p&gt;So, I was shocked again, as I saw my numbers in the chart:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/dparys/WindowsLiveWriter/ImprovingEntityFrameworkPerformance_89CD/shot1_2.png"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="shot1" border="0" alt="shot1" src="http://blogs.msdn.com/blogfiles/dparys/WindowsLiveWriter/ImprovingEntityFrameworkPerformance_89CD/shot1_thumb.png" width="540" height="313" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;The elapsed time was 4 times higher than with plain SqlDataReader. But more worse was the fact the the elapsed processor time was nearly 8 times higher. NHibernate was really good in performance compared to Entity Framework, but LINQ to SQL was still better.&lt;/p&gt;  &lt;p&gt;What was wrong? I couldn’t imagine that we had such an issue in data access using the Entity Framework. I took a look at the code. All test runs are looping 10000 times over the access method to retrieve the customers data. In this loop, each time a connection will be created and closed. Linq to SQL and Linq to Entities are using compiled queries, so, this optimization was already done. I also added in my tests a pre-generated Entity Framework view (using edmgen.exe) to enhance startup performance. Still those poor results.&lt;/p&gt;  &lt;p&gt;Here is the original code from the tests:&lt;/p&gt;  &lt;div&gt;   &lt;div style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;     &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;   1:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;static&lt;/span&gt; List&amp;lt;CustomerResults&amp;gt; GetCustomers()&lt;/pre&gt;

    &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;   2:&lt;/span&gt; {&lt;/pre&gt;

    &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;   3:&lt;/span&gt;     &lt;span style="color: #0000ff"&gt;using&lt;/span&gt; (NorthwindEntities ne = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; NorthwindEntities())&lt;/pre&gt;

    &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;   4:&lt;/span&gt;     {&lt;/pre&gt;

    &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;   5:&lt;/span&gt;         &lt;span style="color: #0000ff"&gt;return&lt;/span&gt; GetCustomersQuery(ne).ToList();&lt;/pre&gt;

    &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;   6:&lt;/span&gt;     }&lt;/pre&gt;

    &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;   7:&lt;/span&gt; }&lt;/pre&gt;

    &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;   8:&lt;/span&gt;&amp;#160; &lt;/pre&gt;

    &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;   9:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;private&lt;/span&gt; &lt;span style="color: #0000ff"&gt;static&lt;/span&gt; Func&amp;lt;NorthwindEntities, IQueryable&amp;lt;CustomerResults&amp;gt;&amp;gt; &lt;/pre&gt;

    &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;  10:&lt;/span&gt;     GetCustomersQuery = CompiledQuery.Compile(&lt;/pre&gt;

    &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;  11:&lt;/span&gt;         (NorthwindEntities ne) =&amp;gt; from c &lt;span style="color: #0000ff"&gt;in&lt;/span&gt; ne.Customers&lt;/pre&gt;

    &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;  12:&lt;/span&gt;                                   select &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; CustomerResults&lt;/pre&gt;

    &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;  13:&lt;/span&gt;                                   {&lt;/pre&gt;

    &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;  14:&lt;/span&gt;                                       CustomerID = c.CustomerID,&lt;/pre&gt;

    &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;  15:&lt;/span&gt;                                       CompanyName = c.CompanyName,&lt;/pre&gt;

    &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;  16:&lt;/span&gt;                                       ContactName = c.ContactName,&lt;/pre&gt;

    &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;  17:&lt;/span&gt;                                       ContactTitle = c.ContactTitle,&lt;/pre&gt;

    &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;  18:&lt;/span&gt;                                       City = c.City,&lt;/pre&gt;

    &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;  19:&lt;/span&gt;                                       Country = c.Country&lt;/pre&gt;

    &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;  20:&lt;/span&gt;                                   });&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;My guess was that the instantiation of the connection string could be the problem. Why? Because several things happen here. First, the EntityConnection which is created when not specifying any argument in the constructor of the typed object context class NorthwindEntities, has to read from the config file. I/O cost. Second, it has to read the metadata information, which is stored by default in the assembly as resource. Second performance cost. Here is my optimization approach. One of the overload constructors is taking an EntityConnection object. Guess what, you probably just use this one connection object during the whole life time of your application, so why not create it once and give it into the constructor. This does not mean that I open the connection beforehand, no, I just create the type EntityConnection and retrieve the meta information in the first call. From that, I reuse this instance, so no need anymore to retrieve the metadata information again.&lt;/p&gt;

&lt;p&gt;Here is the optimization in my code base:&lt;/p&gt;

&lt;div&gt;
  &lt;div style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;
    &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;   1:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;private&lt;/span&gt; &lt;span style="color: #0000ff"&gt;static&lt;/span&gt; EntityConnection entityConnection;&lt;/pre&gt;

    &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;   2:&lt;/span&gt;&amp;#160; &lt;/pre&gt;

    &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;   3:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;static&lt;/span&gt; &lt;span style="color: #0000ff"&gt;void&lt;/span&gt; InitializeConnectionString()&lt;/pre&gt;

    &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;   4:&lt;/span&gt; {&lt;/pre&gt;

    &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;   5:&lt;/span&gt;     SqlConnectionStringBuilder sqlBuilder = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; SqlConnectionStringBuilder();&lt;/pre&gt;

    &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;   6:&lt;/span&gt;     sqlBuilder.DataSource = &lt;span style="color: #006080"&gt;@&amp;quot;(local)\sqlexpress&amp;quot;&lt;/span&gt;;&lt;/pre&gt;

    &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;   7:&lt;/span&gt;     sqlBuilder.InitialCatalog = &lt;span style="color: #006080"&gt;&amp;quot;NorthwindPerfTest&amp;quot;&lt;/span&gt;;&lt;/pre&gt;

    &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;   8:&lt;/span&gt;     sqlBuilder.IntegratedSecurity = &lt;span style="color: #0000ff"&gt;true&lt;/span&gt;;&lt;/pre&gt;

    &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;   9:&lt;/span&gt;     sqlBuilder.MultipleActiveResultSets = &lt;span style="color: #0000ff"&gt;true&lt;/span&gt;;&lt;/pre&gt;

    &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;  10:&lt;/span&gt;&amp;#160; &lt;/pre&gt;

    &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;  11:&lt;/span&gt;&amp;#160; &lt;/pre&gt;

    &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;  12:&lt;/span&gt;     EntityConnectionStringBuilder builder = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; EntityConnectionStringBuilder();&lt;/pre&gt;

    &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;  13:&lt;/span&gt;     builder.Provider = &lt;span style="color: #006080"&gt;&amp;quot;System.Data.SqlClient&amp;quot;&lt;/span&gt;;&lt;/pre&gt;

    &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;  14:&lt;/span&gt;     builder.Metadata = &lt;span style="color: #006080"&gt;&amp;quot;res://*/Customers.csdl|&amp;quot;&lt;/span&gt; +&lt;/pre&gt;

    &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;  15:&lt;/span&gt;                        &lt;span style="color: #006080"&gt;&amp;quot;res://*/Customers.ssdl|&amp;quot;&lt;/span&gt; +&lt;/pre&gt;

    &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;  16:&lt;/span&gt;                        &lt;span style="color: #006080"&gt;&amp;quot;res://*/Customers.msl&amp;quot;&lt;/span&gt;;&lt;/pre&gt;

    &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;  17:&lt;/span&gt;     builder.ProviderConnectionString = sqlBuilder.ToString();&lt;/pre&gt;

    &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;  18:&lt;/span&gt;     &lt;/pre&gt;

    &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;  19:&lt;/span&gt;     entityConnection = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; EntityConnection(builder.ToString());&lt;/pre&gt;

    &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;  20:&lt;/span&gt; }&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;I have a static variable entityConnection which holds the reference on the object. In the constructor I just pass this reference:&lt;/p&gt;

&lt;div&gt;
  &lt;div style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;
    &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;   1:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;static&lt;/span&gt; List&amp;lt;CustomerResults&amp;gt; GetCustomers()&lt;/pre&gt;

    &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;   2:&lt;/span&gt; {&lt;/pre&gt;

    &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;   3:&lt;/span&gt;     &lt;span style="color: #0000ff"&gt;using&lt;/span&gt; (NorthwindEntities ne = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; NorthwindEntities(entityConnection))&lt;/pre&gt;

    &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;   4:&lt;/span&gt;     {&lt;/pre&gt;

    &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;   5:&lt;/span&gt;         &lt;span style="color: #0000ff"&gt;return&lt;/span&gt; GetCustomersQuery(ne).ToList();&lt;/pre&gt;

    &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;   6:&lt;/span&gt;     }&lt;/pre&gt;

    &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;   7:&lt;/span&gt; }&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;Now I have difference numbers to show in my chart:&lt;/p&gt;

&lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/dparys/WindowsLiveWriter/ImprovingEntityFrameworkPerformance_89CD/shot2_2.png"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="shot2" border="0" alt="shot2" src="http://blogs.msdn.com/blogfiles/dparys/WindowsLiveWriter/ImprovingEntityFrameworkPerformance_89CD/shot2_thumb.png" width="540" height="308" /&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;For this specific test scenario I cutted performance cost two times for the elapsed time and four times for the process elapsed time. Hope that helps.&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9533322" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/dparys/archive/tags/English+Posts/default.aspx">English Posts</category><category domain="http://blogs.msdn.com/dparys/archive/tags/Testing/default.aspx">Testing</category><category domain="http://blogs.msdn.com/dparys/archive/tags/Data+Access/default.aspx">Data Access</category><category domain="http://blogs.msdn.com/dparys/archive/tags/Entity+Framework/default.aspx">Entity Framework</category></item><item><title>Was sind relevante Themen in der Softwareentwicklung für Sie?</title><link>http://blogs.msdn.com/dparys/archive/2008/12/03/was-sind-relevante-themen-in-der-softwareentwicklung-f-r-sie.aspx</link><pubDate>Wed, 03 Dec 2008 19:19:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9170644</guid><dc:creator>dparys</dc:creator><slash:comments>5</slash:comments><comments>http://blogs.msdn.com/dparys/comments/9170644.aspx</comments><wfw:commentRss>http://blogs.msdn.com/dparys/commentrss.aspx?PostID=9170644</wfw:commentRss><wfw:comment>http://blogs.msdn.com/dparys/rsscomments.aspx?PostID=9170644</wfw:comment><description>&lt;P&gt;Lange Zeit bevor ich bei Microsoft war, habe ich schon in diversen Firmen eigentlich immer aus eigenem Antrieb heraus recht schnell Technologie adaptiert und auch während laufender Projekte reingebracht. Den Mehraufwand hat man gerne selbst getragen (oder tragen lassen, Entschuldigung schon mal an dieser Stelle, Ihr wisst wer gemeint ist) um das Projekt / Produkt auf eine neue technische Ebene zu heben. Meist hat sich der Aufwand auch gelohnt.&lt;/P&gt;
&lt;P&gt;Seit ich bei Microsoft bin, liegt hier mein Fokus natürlich verstärkt auf die Microsoft Technologie. Ich möchte mal sagen das ich nicht diesen &lt;A href="http://ralfw.blogspot.com/2008/05/microsoftdmmerung.html" mce_href="http://ralfw.blogspot.com/2008/05/microsoftdmmerung.html"&gt;Bias&lt;/A&gt; habe über den Ralf Westphal geschrieben hat, aber mein "Abdriften" in andere Technologie Welten ist definitiv geringer geworden. &lt;/P&gt;
&lt;P&gt;Warum schreibe ich das eigentlich? Ganz einfach, nach dem Auswerten der Technical Summit Feedbacks ist mir aufgefallen das die Themen kaum Relevanz für die Teilnehmer hatten und ich nicht von mir ausgehen möchte was relevant ist. Was ich wirklich Cool finden würde, wären Kommentare was für &lt;STRONG&gt;&lt;EM&gt;Sie relevante Softwareentwicklungsthemen &lt;/EM&gt;&lt;/STRONG&gt;sind.&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9170644" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/dparys/archive/tags/XPSP2/default.aspx">XPSP2</category><category domain="http://blogs.msdn.com/dparys/archive/tags/Connected+Systems/default.aspx">Connected Systems</category><category domain="http://blogs.msdn.com/dparys/archive/tags/SQL+Server/default.aspx">SQL Server</category><category domain="http://blogs.msdn.com/dparys/archive/tags/CodeClips/default.aspx">CodeClips</category><category domain="http://blogs.msdn.com/dparys/archive/tags/Software+Factories/default.aspx">Software Factories</category><category domain="http://blogs.msdn.com/dparys/archive/tags/Visual+Studio/default.aspx">Visual Studio</category><category domain="http://blogs.msdn.com/dparys/archive/tags/VPC/default.aspx">VPC</category><category domain="http://blogs.msdn.com/dparys/archive/tags/C_2B002B002F00_CLI/default.aspx">C++/CLI</category><category domain="http://blogs.msdn.com/dparys/archive/tags/HPC/default.aspx">HPC</category><category domain="http://blogs.msdn.com/dparys/archive/tags/WCF/default.aspx">WCF</category><category domain="http://blogs.msdn.com/dparys/archive/tags/WF/default.aspx">WF</category><category domain="http://blogs.msdn.com/dparys/archive/tags/VSTS_2F00_TFS/default.aspx">VSTS/TFS</category><category domain="http://blogs.msdn.com/dparys/archive/tags/Dev+Tools/default.aspx">Dev Tools</category><category domain="http://blogs.msdn.com/dparys/archive/tags/C_2300_/default.aspx">C#</category><category domain="http://blogs.msdn.com/dparys/archive/tags/XNA/default.aspx">XNA</category><category domain="http://blogs.msdn.com/dparys/archive/tags/Coding4Fun/default.aspx">Coding4Fun</category><category domain="http://blogs.msdn.com/dparys/archive/tags/Dies+und+Das/default.aspx">Dies und Das</category><category domain="http://blogs.msdn.com/dparys/archive/tags/Conference/default.aspx">Conference</category><category domain="http://blogs.msdn.com/dparys/archive/tags/Web+2.0/default.aspx">Web 2.0</category><category domain="http://blogs.msdn.com/dparys/archive/tags/ASP.NET/default.aspx">ASP.NET</category><category domain="http://blogs.msdn.com/dparys/archive/tags/Silverlight/default.aspx">Silverlight</category><category domain="http://blogs.msdn.com/dparys/archive/tags/Orcas/default.aspx">Orcas</category><category domain="http://blogs.msdn.com/dparys/archive/tags/Vista/default.aspx">Vista</category><category domain="http://blogs.msdn.com/dparys/archive/tags/Security/default.aspx">Security</category><category domain="http://blogs.msdn.com/dparys/archive/tags/MSDN/default.aspx">MSDN</category><category domain="http://blogs.msdn.com/dparys/archive/tags/MFC/default.aspx">MFC</category><category domain="http://blogs.msdn.com/dparys/archive/tags/Windows+Server/default.aspx">Windows Server</category><category domain="http://blogs.msdn.com/dparys/archive/tags/IIS7/default.aspx">IIS7</category><category domain="http://blogs.msdn.com/dparys/archive/tags/Open+XML/default.aspx">Open XML</category><category domain="http://blogs.msdn.com/dparys/archive/tags/VSTS/default.aspx">VSTS</category><category domain="http://blogs.msdn.com/dparys/archive/tags/SQL+Server+2008/default.aspx">SQL Server 2008</category><category domain="http://blogs.msdn.com/dparys/archive/tags/Events/default.aspx">Events</category><category domain="http://blogs.msdn.com/dparys/archive/tags/WDF/default.aspx">WDF</category><category domain="http://blogs.msdn.com/dparys/archive/tags/TechTalk/default.aspx">TechTalk</category><category domain="http://blogs.msdn.com/dparys/archive/tags/Windows+Live/default.aspx">Windows Live</category><category domain="http://blogs.msdn.com/dparys/archive/tags/.NET+Framework/default.aspx">.NET Framework</category><category domain="http://blogs.msdn.com/dparys/archive/tags/Testing/default.aspx">Testing</category><category domain="http://blogs.msdn.com/dparys/archive/tags/PLINQ/default.aspx">PLINQ</category><category domain="http://blogs.msdn.com/dparys/archive/tags/Tools/default.aspx">Tools</category><category domain="http://blogs.msdn.com/dparys/archive/tags/Data+Access/default.aspx">Data Access</category><category domain="http://blogs.msdn.com/dparys/archive/tags/C_2B002B00_/default.aspx">C++</category><category domain="http://blogs.msdn.com/dparys/archive/tags/Games/default.aspx">Games</category><category domain="http://blogs.msdn.com/dparys/archive/tags/Services/default.aspx">Services</category><category domain="http://blogs.msdn.com/dparys/archive/tags/Virtualization/default.aspx">Virtualization</category><category domain="http://blogs.msdn.com/dparys/archive/tags/Architecture/default.aspx">Architecture</category><category domain="http://blogs.msdn.com/dparys/archive/tags/Dynamic+Languages/default.aspx">Dynamic Languages</category><category domain="http://blogs.msdn.com/dparys/archive/tags/Windows/default.aspx">Windows</category><category domain="http://blogs.msdn.com/dparys/archive/tags/LINQ/default.aspx">LINQ</category><category domain="http://blogs.msdn.com/dparys/archive/tags/Mein+Senf/default.aspx">Mein Senf</category><category domain="http://blogs.msdn.com/dparys/archive/tags/Parallel+Computing/default.aspx">Parallel Computing</category><category domain="http://blogs.msdn.com/dparys/archive/tags/Concurrency/default.aspx">Concurrency</category><category domain="http://blogs.msdn.com/dparys/archive/tags/WPF/default.aspx">WPF</category><category domain="http://blogs.msdn.com/dparys/archive/tags/Entity+Framework/default.aspx">Entity Framework</category><category domain="http://blogs.msdn.com/dparys/archive/tags/PDC2008/default.aspx">PDC2008</category><category domain="http://blogs.msdn.com/dparys/archive/tags/Windows+Azure/default.aspx">Windows Azure</category><category domain="http://blogs.msdn.com/dparys/archive/tags/Model+Driven+Development/default.aspx">Model Driven Development</category><category domain="http://blogs.msdn.com/dparys/archive/tags/.NET+Services/default.aspx">.NET Services</category><category domain="http://blogs.msdn.com/dparys/archive/tags/Azure+Services/default.aspx">Azure Services</category><category domain="http://blogs.msdn.com/dparys/archive/tags/Live+Services/default.aspx">Live Services</category></item><item><title>ADO.NET Data Services: Service Operationen statt Entities</title><link>http://blogs.msdn.com/dparys/archive/2008/10/17/ado-net-data-services-service-operationen-statt-entities.aspx</link><pubDate>Fri, 17 Oct 2008 14:35:16 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9002885</guid><dc:creator>dparys</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.msdn.com/dparys/comments/9002885.aspx</comments><wfw:commentRss>http://blogs.msdn.com/dparys/commentrss.aspx?PostID=9002885</wfw:commentRss><wfw:comment>http://blogs.msdn.com/dparys/rsscomments.aspx?PostID=9002885</wfw:comment><description>&lt;p&gt;In den ADO.NET Data Services werden Entitäten durch die Schnittstelle &lt;em&gt;IDataServiceConfiguration&lt;/em&gt; verfügbar gemacht. Mittels &lt;/p&gt;  &lt;pre class="code"&gt;config.SetEntitySetAccessRule( &lt;span style="color: #a31515"&gt;&amp;quot;Products&amp;quot;&lt;/span&gt;, &lt;span style="color: #2b91af"&gt;EntitySetRights&lt;/span&gt;.AllRead );&lt;/pre&gt;

&lt;p&gt;wird zum Beispiel das EntitySet &lt;em&gt;Products&lt;/em&gt; für lesende Zugriffe angeboten. Was ist aber wenn man nicht generell einen Zugriff auf das &lt;em&gt;Products &lt;/em&gt;Entität erlauben möchte, sondern vielmehr die Anzeige der Produkte einschränken will? Zum Beispiel auf die Zugehörigkeit zu einer Warengruppe? &lt;/p&gt;

&lt;pre class="code"&gt;[&lt;span style="color: #2b91af"&gt;WebGet&lt;/span&gt;()]
&lt;span style="color: blue"&gt;public &lt;/span&gt;&lt;span style="color: #2b91af"&gt;IQueryable&lt;/span&gt;&amp;lt;&lt;span style="color: #2b91af"&gt;Products&lt;/span&gt;&amp;gt; GetProductsByCategory( &lt;span style="color: blue"&gt;int &lt;/span&gt;categoryId )
{
    &lt;span style="color: blue"&gt;return &lt;/span&gt;GetAdapter().GetProductsByCategory( categoryId );
}&lt;/pre&gt;

&lt;p&gt;Das lässt sich mit Hilfe eines &lt;em&gt;QueryInterceptor&lt;/em&gt;’s realisieren. Der &lt;em&gt;QueryInterceptor&lt;/em&gt; wird für jede Abfrage auf ein definiertes EntitySet aufgerufen und gibt über eine Vergleichsfunktion entsprechend einen bool zurück. Die Lösung ist also sehr einfach. Man gibt standardmässig für alle &lt;em&gt;Products&lt;/em&gt; Entitäten ein &lt;em&gt;false&lt;/em&gt; zurück.&lt;/p&gt;

&lt;pre class="code"&gt;[&lt;span style="color: #2b91af"&gt;QueryInterceptor&lt;/span&gt;(&lt;span style="color: #a31515"&gt;&amp;quot;Products&amp;quot;&lt;/span&gt;)]
&lt;span style="color: blue"&gt;public &lt;/span&gt;&lt;span style="color: #2b91af"&gt;Expression&lt;/span&gt;&amp;lt; &lt;span style="color: #2b91af"&gt;Func&lt;/span&gt;&amp;lt; &lt;span style="color: #2b91af"&gt;Products&lt;/span&gt;, &lt;span style="color: blue"&gt;bool &lt;/span&gt;&amp;gt; &amp;gt; OnQueryProducts()
{
    &lt;span style="color: blue"&gt;return &lt;/span&gt;p =&amp;gt; &lt;span style="color: blue"&gt;false&lt;/span&gt;;            
}&lt;/pre&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9002885" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/dparys/archive/tags/Data+Access/default.aspx">Data Access</category><category domain="http://blogs.msdn.com/dparys/archive/tags/Services/default.aspx">Services</category><category domain="http://blogs.msdn.com/dparys/archive/tags/Entity+Framework/default.aspx">Entity Framework</category></item><item><title>Entity Framework: Aktualisieren des Datenmodells</title><link>http://blogs.msdn.com/dparys/archive/2008/10/17/entity-framework-aktualisieren-des-datenmodells.aspx</link><pubDate>Fri, 17 Oct 2008 12:42:26 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9002809</guid><dc:creator>dparys</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.msdn.com/dparys/comments/9002809.aspx</comments><wfw:commentRss>http://blogs.msdn.com/dparys/commentrss.aspx?PostID=9002809</wfw:commentRss><wfw:comment>http://blogs.msdn.com/dparys/rsscomments.aspx?PostID=9002809</wfw:comment><description>&lt;p&gt;Hat man erstmal mit dem Entity Framework ein entsprechendes Entity Data Model (kurz EDM) erstellt, so kommt früher oder später die Frage: Wie aktualisiert man das Modell eigentlich?&lt;/p&gt;  &lt;p&gt;Im Visual Studio 2008 EDM Designer (Dateiendung .edmx) gibt es hierzu ein Kontextmenü&amp;#160; Eintrag zum aktualisieren. Folgende Ausgangslage: Ein Modell mit drei Entitäten, in der Datenbank abgebildet durch 4 Tabellen.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/dparys/WindowsLiveWriter/EntityFrameworkAktualisierendesDatenmode_A466/shot1_2.png"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="shot1" border="0" alt="shot1" src="http://blogs.msdn.com/blogfiles/dparys/WindowsLiveWriter/EntityFrameworkAktualisierendesDatenmode_A466/shot1_thumb.png" width="525" height="234" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Der Datenbank-Verantwortliche möchte gerne die Datenbank umstellen und die Tabelle ReferenceProducts rausschmeissen, was zur Folge hat dass das EDM aktualisiert werden muss. Hierzu wählt man nun den Kontextmenü Eintrag “&lt;em&gt;Update Model from Database…&lt;/em&gt;”&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/dparys/WindowsLiveWriter/EntityFrameworkAktualisierendesDatenmode_A466/shot2_2.png"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="shot2" border="0" alt="shot2" src="http://blogs.msdn.com/blogfiles/dparys/WindowsLiveWriter/EntityFrameworkAktualisierendesDatenmode_A466/shot2_thumb.png" width="479" height="431" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Daraufhin wird das aktuelle Datenbank-Schema eingelesen und man sieht die vorhandenen Tabellenänderungen auf einem Blick:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/dparys/WindowsLiveWriter/EntityFrameworkAktualisierendesDatenmode_A466/shot3a_2.png"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="shot3a" border="0" alt="shot3a" src="http://blogs.msdn.com/blogfiles/dparys/WindowsLiveWriter/EntityFrameworkAktualisierendesDatenmode_A466/shot3a_thumb.png" width="589" height="135" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Die &lt;em&gt;Products&lt;/em&gt; Tabelle hat einen &lt;em&gt;Uniqueidentifier&lt;/em&gt; (UUID) erhalten, die Tabelle &lt;em&gt;ReferenceProducts&lt;/em&gt; wurde komplett entfernt. Was aber vollkommen missverständlich ist, das der Kontextmenü Eintrag “&lt;em&gt;Update Model from Database…&lt;/em&gt;” &lt;strong&gt;lediglich &lt;/strong&gt;die Schema Storage Definition (SSDL) aktualisiert, nicht jedoch das Konzeptionelle Modell (CSDL). Man hätte einfach den Menüpunkt anders benennen sollen.&lt;/p&gt;  &lt;p&gt;Auszug der angepassten SSDL:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/dparys/WindowsLiveWriter/EntityFrameworkAktualisierendesDatenmode_A466/shot4_2.png"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="shot4" border="0" alt="shot4" src="http://blogs.msdn.com/blogfiles/dparys/WindowsLiveWriter/EntityFrameworkAktualisierendesDatenmode_A466/shot4_thumb.png" width="529" height="194" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Warum wird nur die SSDL angepasst? Ganz einfach, das EDM erlaubt eine Abstraktion zur Datenquelle, insofern ist es denkbar einfach das Schema und das Mapping auszutauschen und das konzeptionelle Modell weiter bestehen zu lassen.&lt;/p&gt;  &lt;p&gt;In meinem Beispiel allerdings muss ich das Konzeptionelle Modell anpassen, da ich auch im Modell mit einer &lt;em&gt;Guid&lt;/em&gt; arbeiten möchte anstelle des &lt;em&gt;Integers &lt;/em&gt;und das Objekt &lt;em&gt;ReferenceProducts &lt;/em&gt;nicht benötige.&lt;/p&gt;  &lt;p&gt;Hier das CSDL das noch angepasst werden muss:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/dparys/WindowsLiveWriter/EntityFrameworkAktualisierendesDatenmode_A466/shot5_2.png"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="shot5" border="0" alt="shot5" src="http://blogs.msdn.com/blogfiles/dparys/WindowsLiveWriter/EntityFrameworkAktualisierendesDatenmode_A466/shot5_thumb.png" width="542" height="375" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Man sieht das hier keinerlei Änderungen automatisch durchgeführt werden. Nachdem ich alle Referenzen auf &amp;quot;&lt;em&gt;ReferencepProducts&lt;/em&gt;” entfernt habe und auch ein &lt;em&gt;Guid &lt;/em&gt;für die &lt;em&gt;ProductId &lt;/em&gt;im Objekt eingetragen habe, steht nun mein neues EDM bereit:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/dparys/WindowsLiveWriter/EntityFrameworkAktualisierendesDatenmode_A466/shot6_2.png"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="shot6" border="0" alt="shot6" src="http://blogs.msdn.com/blogfiles/dparys/WindowsLiveWriter/EntityFrameworkAktualisierendesDatenmode_A466/shot6_thumb.png" width="455" height="322" /&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9002809" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/dparys/archive/tags/Data+Access/default.aspx">Data Access</category><category domain="http://blogs.msdn.com/dparys/archive/tags/Entity+Framework/default.aspx">Entity Framework</category></item><item><title>Service Operations und mehr mit ADO.NET Data Services</title><link>http://blogs.msdn.com/dparys/archive/2008/10/17/service-operations-und-mehr-mit-ado-net-data-services.aspx</link><pubDate>Fri, 17 Oct 2008 11:30:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9002755</guid><dc:creator>dparys</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.msdn.com/dparys/comments/9002755.aspx</comments><wfw:commentRss>http://blogs.msdn.com/dparys/commentrss.aspx?PostID=9002755</wfw:commentRss><wfw:comment>http://blogs.msdn.com/dparys/rsscomments.aspx?PostID=9002755</wfw:comment><description>&lt;p&gt;Wer Dokumentation liest ist klar im Vorteil. Ich gebe zu, ich schaue mir eine API an und versuche Intuitiv mit dieser zu arbeiten. Doch manchmal gibt es einfach die Notwendigkeit die Dokumentation zu lesen. &lt;/p&gt;  &lt;p&gt;Was ist mein Problem? Ich habe ein Entity Framework Modell das Kategorien und Produkte enthält. Beide Entities sind mit Datenbankgenerierten IDs ausgestattet. Die Entitäten werden von einem Repository gekapselt und das Repository implementiert auch noch zusätzliche Funktionalität.&lt;/p&gt;  &lt;div&gt;   &lt;div style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;     &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;   1:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;interface&lt;/span&gt; ICatalogServiceRepository&lt;/pre&gt;

    &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;   2:&lt;/span&gt; {&lt;/pre&gt;

    &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;   3:&lt;/span&gt;     IQueryable&amp;lt;Categories&amp;gt; GetCategories();&lt;/pre&gt;

    &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;   4:&lt;/span&gt;     IQueryable&amp;lt;Products&amp;gt; GetProductsByCategory( Categories category );&lt;/pre&gt;

    &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;   5:&lt;/span&gt;     IQueryable&amp;lt;Categories&amp;gt; GetCategoriesWithProducts();&lt;/pre&gt;

    &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;   6:&lt;/span&gt;     Guid GetExternalProductReference(Products product);&lt;/pre&gt;

    &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;   7:&lt;/span&gt;     IQueryable&amp;lt;Guid&amp;gt; GetExternalProductReferencesByProducts(&lt;/pre&gt;

    &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;   8:&lt;/span&gt;                             IQueryable&amp;lt;Products&amp;gt; products);&lt;/pre&gt;

    &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;   9:&lt;/span&gt; }&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;Dies ist die Schnittstelle um auf die Entitäten zuzugreifen. Rein lesend. Die Deklarationen in Zeile 6 und Zeile 7 unterstützen das Mapping von Produkt-Entitäten auf Systeme ausserhalb unseres Modell. Hier wird bei Bedarf eine &lt;em&gt;Guid&lt;/em&gt; erstellt, wenn eine externe Referenz zu einem Objekt angefordert wird.&lt;/p&gt;

&lt;p&gt;Das Repository soll in verschiedenen Umgebungen zum Einsatz kommen, unter anderem auch in einem ADO.NET Data Service. Leider kann ich dort folgendes &lt;u&gt;&lt;strong&gt;nicht&lt;/strong&gt;&lt;/u&gt; deklarieren:&lt;/p&gt;

&lt;div&gt;
  &lt;div style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;
    &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;   1:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;static&lt;/span&gt; &lt;span style="color: #0000ff"&gt;void&lt;/span&gt; InitializeService( IDataServiceConfiguration config )&lt;/pre&gt;

    &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;   2:&lt;/span&gt; {&lt;/pre&gt;

    &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;   3:&lt;/span&gt;     &lt;span style="color: #008000"&gt;// Wenn ich keine Entitäten im Zugriff erlaube, kann ich diese auch&lt;/span&gt;&lt;/pre&gt;

    &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;   4:&lt;/span&gt;     &lt;span style="color: #008000"&gt;// nicht in Service Operationen einsetzen&lt;/span&gt;&lt;/pre&gt;

    &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;   5:&lt;/span&gt;     config.SetEntitySetAccessRule( &lt;span style="color: #006080"&gt;&amp;quot;*&amp;quot;&lt;/span&gt;, EntitySetRights.None );&lt;/pre&gt;

    &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;   6:&lt;/span&gt;&amp;#160; &lt;/pre&gt;

    &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;   7:&lt;/span&gt;     config.SetServiceOperationAccessRule( &lt;span style="color: #006080"&gt;&amp;quot;GetCategories&amp;quot;&lt;/span&gt;, &lt;/pre&gt;

    &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;   8:&lt;/span&gt;         ServiceOperationRights.AllRead );&lt;/pre&gt;

    &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;   9:&lt;/span&gt;     &lt;span style="color: #008000"&gt;// Diese Service Operation ist ungültig ==&amp;gt; Parameter != Primitive Type&lt;/span&gt;&lt;/pre&gt;

    &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;  10:&lt;/span&gt;     config.SetServiceOperationAccessRule( &lt;span style="color: #006080"&gt;&amp;quot;GetProductsByCategory&amp;quot;&lt;/span&gt;, &lt;/pre&gt;

    &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;  11:&lt;/span&gt;         ServiceOperationRights.AllRead );&lt;/pre&gt;

    &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;  12:&lt;/span&gt;     config.SetServiceOperationAccessRule( &lt;span style="color: #006080"&gt;&amp;quot;GetCategoriesWithProducts&amp;quot;&lt;/span&gt;, &lt;/pre&gt;

    &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;  13:&lt;/span&gt;         ServiceOperationRights.AllRead );&lt;/pre&gt;

    &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;  14:&lt;/span&gt;     &lt;span style="color: #008000"&gt;// Diese Service Operation ist ungültig ==&amp;gt; Parameter != Primitive Type&lt;/span&gt;&lt;/pre&gt;

    &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;  15:&lt;/span&gt;     config.SetServiceOperationAccessRule( &lt;span style="color: #006080"&gt;&amp;quot;GetExternalProductReference&amp;quot;&lt;/span&gt;, &lt;/pre&gt;

    &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;  16:&lt;/span&gt;         ServiceOperationRights.AllRead );&lt;/pre&gt;

    &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;  17:&lt;/span&gt;     &lt;span style="color: #008000"&gt;// Diese Service Operation ist ungültig ==&amp;gt; Parameter != Primitive Type&lt;/span&gt;&lt;/pre&gt;

    &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;  18:&lt;/span&gt;     config.SetServiceOperationAccessRule( &lt;span style="color: #006080"&gt;&amp;quot;GetExternalProductReferencesByProducts&amp;quot;&lt;/span&gt;, &lt;/pre&gt;

    &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;  19:&lt;/span&gt;         ServiceOperationRights.AllRead );&lt;/pre&gt;

    &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;  20:&lt;/span&gt; }&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;Ein Blick in die Dokumentation sagt folgendes:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;
    &lt;p&gt;&lt;em&gt;The method must accept only &lt;tt&gt;[in]&lt;/tt&gt; parameters.&lt;/em&gt;&lt;/p&gt;

    &lt;ul&gt;
      &lt;li&gt;
        &lt;p&gt;&lt;em&gt;If parameters are defined, the type of each parameter must be a primitive type.&lt;/em&gt;&lt;/p&gt;
      &lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;

  &lt;li&gt;
    &lt;p&gt;&lt;em&gt;The method must return void, &lt;b&gt;IEnumerable&amp;lt;T&amp;gt;&lt;/b&gt;, &lt;b&gt;IQueryable&amp;lt;T&amp;gt;&lt;/b&gt;, &lt;b&gt;T&lt;/b&gt;, or a primitive class such as integer or string.&lt;/em&gt;&lt;/p&gt;
  &lt;/li&gt;

  &lt;ul&gt;
    &lt;li&gt;
      &lt;p&gt;&lt;em&gt;&lt;b&gt;T&lt;/b&gt; MUST be a class that represents an entity type in the data model being exposed by the data service.&lt;/em&gt;&lt;/p&gt;
    &lt;/li&gt;

    &lt;li&gt;
      &lt;p&gt;&lt;em&gt;In order to support query options such as sorting, paging, and filtering, service operation methods should return &lt;b&gt;IQueryable&amp;lt;T&amp;gt;&lt;/b&gt;.&lt;/em&gt;&lt;/p&gt;
    &lt;/li&gt;
  &lt;/ul&gt;

  &lt;li&gt;
    &lt;p&gt;&lt;em&gt;…&lt;/em&gt;&lt;/p&gt;
  &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Den Rest habe ich mal weggelassen. Die Konsequenz ist das beim Starten der Service einen Request Fehler bringt und man in die Logs schauen soll. &lt;/p&gt;

&lt;p&gt;Ich möchte nun nicht mein Entity Modell entsprechend dem ADO.NET Data Service anpassen, noch möchte ich mein Repository so auslegen das es für einen ADO.NET Data Service passt. Ich werde nicht herum kommen einen Adapter zu schreiben, der entsprechend die Regeln für den ADO.NET Data Service sicherstellt und mein Repository nutzen kann.&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9002755" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/dparys/archive/tags/Connected+Systems/default.aspx">Connected Systems</category><category domain="http://blogs.msdn.com/dparys/archive/tags/C_2300_/default.aspx">C#</category><category domain="http://blogs.msdn.com/dparys/archive/tags/.NET+Framework/default.aspx">.NET Framework</category><category domain="http://blogs.msdn.com/dparys/archive/tags/Data+Access/default.aspx">Data Access</category><category domain="http://blogs.msdn.com/dparys/archive/tags/Services/default.aspx">Services</category><category domain="http://blogs.msdn.com/dparys/archive/tags/Architecture/default.aspx">Architecture</category><category domain="http://blogs.msdn.com/dparys/archive/tags/Entity+Framework/default.aspx">Entity Framework</category></item><item><title>Entity Framework: Selektieren eines Wertes</title><link>http://blogs.msdn.com/dparys/archive/2008/10/15/entity-framework-selektieren-eines-wertes.aspx</link><pubDate>Wed, 15 Oct 2008 17:02:39 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9000611</guid><dc:creator>dparys</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.msdn.com/dparys/comments/9000611.aspx</comments><wfw:commentRss>http://blogs.msdn.com/dparys/commentrss.aspx?PostID=9000611</wfw:commentRss><wfw:comment>http://blogs.msdn.com/dparys/rsscomments.aspx?PostID=9000611</wfw:comment><description>&lt;p&gt;Auf der &lt;a href="http://www.adc08.de/"&gt;ADC08&lt;/a&gt; wurde mir die Frage gestellt, wie man einen skalaren Wert anstatt das komplette Objekt als Resultat einer LINQ Abfrage erhält. &lt;/p&gt;  &lt;p&gt;Fragt man entsrpechend die Northwind Datenbank per Entity Framework ab so liefert die folgende Abfrage als Resultat die Schnittstelle &lt;em&gt;IQueryable&amp;lt;Products&amp;gt;&lt;/em&gt; zurück.&lt;/p&gt;  &lt;div&gt;   &lt;div style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;     &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;   1:&lt;/span&gt; var query = from p &lt;span style="color: #0000ff"&gt;in&lt;/span&gt; context.Products&lt;/pre&gt;

    &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;   2:&lt;/span&gt;             select p;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;Möchte man nun einen skalaren Wert haben, so muss man lediglich im &lt;em&gt;select&lt;/em&gt; Fragment die Eigenschaft spezifizieren, die man projizieren möchte.&lt;/p&gt;

&lt;div&gt;
  &lt;div style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;
    &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;   1:&lt;/span&gt; var query = from p &lt;span style="color: #0000ff"&gt;in&lt;/span&gt; context.Products&lt;/pre&gt;

    &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;   2:&lt;/span&gt;             select p.ProductId;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;&lt;/p&gt;
Das Ergebnis ist &lt;em&gt;IQueryable&amp;lt;Int32&amp;gt;&lt;/em&gt; und somit hat man nur den skalaren Wert projiziert.&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9000611" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/dparys/archive/tags/Data+Access/default.aspx">Data Access</category><category domain="http://blogs.msdn.com/dparys/archive/tags/Entity+Framework/default.aspx">Entity Framework</category></item></channel></rss>