<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://msmvps.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>Search results for 'app:weblogs' matching tag 'Entity Framework'</title><link>http://msmvps.com/search/SearchResults.aspx?q=app:weblogs&amp;tag=Entity+Framework&amp;orTags=0&amp;o=DateDescending</link><description>Search results for 'app:weblogs' matching tag 'Entity Framework'</description><dc:language>en-US</dc:language><generator>CommunityServer 2008.5 SP2 (Build: 40407.4157)</generator><item><title>ADO.NET Entity Model Helpers</title><link>http://msmvps.com/blogs/bmains/archive/2009/10/01/ado-net-entity-model-helpers.aspx</link><pubDate>Thu, 01 Oct 2009 05:00:00 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1728864</guid><dc:creator>bmains</dc:creator><description>&lt;p&gt;I&amp;#39;m starting to get into a project using ADO.NET entity model.&amp;nbsp; This is a pretty cool technology, and I like a lot of the features (especially the logical model approach).&amp;nbsp; There are some things I really dislike about Phase 1, like having to delete the entire model or edit SSDL manually (or with XML tool) - anybody know of some free tools available for this?&amp;nbsp; But overall, I like the approach, and the concept, so I look forward to adding features.&lt;/p&gt;
&lt;p&gt;Some features I want to add is automatic logging.&amp;nbsp; Sometimes, you just need to know what&amp;#39;s going on with your application to see if the logic is working correctly.&amp;nbsp; I often create a logger class, create an ILogger interface with a LogError and LogMessage methods, and create derived classes to log to event log, console, health monitoring, etc.&amp;nbsp; That is out of scope for this article, but I want to focus on the idea of extensibility.&amp;nbsp; I&amp;#39;ve been reading articles about how to plugin to the provider architecture and other approaches, but I don&amp;#39;t personally want to affect the architecture.&amp;nbsp; Rather, I&amp;#39;d rather take the wrapping approach.&amp;nbsp; This is separated and isolated from any provider architecture changes over the years.&amp;nbsp; While that&amp;#39;s not a major concern anyway (at least for me), a separate class seems like a good approach.&lt;/p&gt;
&lt;p&gt;So I use a class that does something like this:&lt;/p&gt;
&lt;p&gt;public class ObjectContextHelpers&lt;br /&gt;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; public static&amp;nbsp;void&amp;nbsp;SaveNewObject(CustomObjectContext context, string entitySetName, object entity)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //get a reference to the logger - pass in as ref or via singleton, or some other approach&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;logger.LogMessage(&amp;quot;Attempting to save object for entity set &amp;quot; + entitySetName);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //Can log other details, number of objects commiting,&amp;nbsp;details about object state entries,&amp;nbsp;and other information&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; try&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;context.AddObject(entitySetName,&amp;nbsp;entity);&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; catch(Exception ex) { logger.LogMessage(&amp;quot;Saving object failed: &amp;quot; + ex.ToString());&amp;nbsp;}&lt;br /&gt;&amp;nbsp;&amp;nbsp;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;logger.LogMessage(&amp;quot;Saved object for entity set &amp;quot; + entitySetName);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; public static CustomObjectContext Create()&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return new&amp;nbsp;CustomObjectContext(ConfigurationManager.ConnectionStrings[&amp;quot;ConnString&amp;quot;].ConnectionString);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;}&lt;/p&gt;
&lt;p&gt;Here we have a Create method that uses one common connection string, which is a connection string pre-configured (assuming that you aren&amp;#39;t building a custom library that may require configurability).&lt;/p&gt;</description></item><item><title>Improvements in Entity Framework 4.0</title><link>http://msmvps.com/blogs/nunogodinho/archive/2009/08/06/improvements-in-entity-framework-4-0.aspx</link><pubDate>Thu, 06 Aug 2009 05:00:00 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1713873</guid><dc:creator>NunoGodinho</dc:creator><description>&lt;p&gt;&amp;#160;&amp;#160; With .NET 4.0 a lot of new features and technologies will see the light, as long as others will get improved, and Entity Framework will be one of those technologies that will get improved.&lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160; A lot of this changes are being made on the Query pipeline, that means that are being done on the translation from Linq to SQL code, and some of the changes in Beta 1 are the following:&lt;/p&gt;  &lt;ol&gt;   &lt;li&gt;Avoid projecting all columns in nested queries&lt;/li&gt;    &lt;ul&gt;     &lt;li&gt;Instead of making a query for the complete set of columns and the make the projection on top of it, just make the projection and get only the needed columns&lt;/li&gt;   &lt;/ul&gt;    &lt;li&gt;Avoiding Unnecessary IS NULL Checks in LINQ to Entities Queries&lt;/li&gt;    &lt;ul&gt;     &lt;li&gt;remove the Is null check when using Joins&lt;/li&gt;   &lt;/ul&gt;    &lt;li&gt;Additional join elimination:&amp;#160; Eliminate parent table in “Child Left Outer Join Parent”&lt;/li&gt;    &lt;ul&gt;     &lt;li&gt;Avoid having a child left outer join if no column from that relation is needed for the projection&lt;/li&gt;   &lt;/ul&gt;    &lt;li&gt;Using IN instead of nested OR’s&lt;/li&gt;    &lt;ul&gt;     &lt;li&gt;Instead of having several Or’s in place such as “CategoryId = 1 OR CategoryID = 2 (…)” have “CategoryId In (1,2,…)”&lt;/li&gt;   &lt;/ul&gt;    &lt;li&gt;Translating more of LINQ’s GroupBy operator into GROUP BY&lt;/li&gt;    &lt;ul&gt;     &lt;li&gt;Better use of the SQL Group By in order to simplify the query&lt;/li&gt;   &lt;/ul&gt;    &lt;li&gt;Avoiding “Cast (1 as bit)”, using “1” instead&lt;/li&gt;    &lt;li&gt;Simplifying some queries that go against a subtype in a type hierarchy&lt;/li&gt; &lt;/ol&gt;  &lt;p&gt;&amp;#160;&amp;#160; Some of the changes after Beta 1:&lt;/p&gt;  &lt;ol&gt;   &lt;li&gt;Elimination of null sentinels &lt;/li&gt;    &lt;ul&gt;     &lt;li&gt;In the output query there is often the constant 1 projected both in nested and in top-most queries. By avoiding it and reusing other columns for the same purpose in many cases we are able to avoid levels of nesting. &lt;/li&gt;   &lt;/ul&gt;    &lt;li&gt;Additional Join Elimination &lt;/li&gt;    &lt;li&gt;Use of Inner Joins instead of Left Outer Joins when possible &lt;/li&gt;    &lt;li&gt;Provide mechanism for efficient queries on non-Unicode columns &lt;/li&gt;    &lt;ul&gt;     &lt;li&gt;We now generate non-unicode constants and parameters when these are used in LINQ to Entities queries in comparisons with non-unicode columns. This allows indexes to be used by SQL Server. &lt;/li&gt;   &lt;/ul&gt;    &lt;li&gt;Improve the translation of the functions String.StartsWith, String.Contains and String.EndsWith in LINQ to Entites to use LIKE. &lt;/li&gt;    &lt;li&gt;Improve the translation of the canonical functions StartsWith, Contains and EndsWith to use LIKE (these canonical functions became available in .NET 4.0 Beta1) &lt;/li&gt;    &lt;li&gt;Collapse multiple Case statements into one &lt;/li&gt; &lt;/ol&gt;  &lt;p&gt;&amp;#160;&amp;#160; You can read more about this topic on &lt;a href="http://blogs.msdn.com/adonet/archive/2009/08/05/improvements-to-the-generated-sql-in-net-4-0-beta1.aspx" target="_blank"&gt;this ADO.NET Team post&lt;/a&gt;.&lt;/p&gt;</description></item><item><title>Interesting reading about Entity Framework 4.0</title><link>http://msmvps.com/blogs/nunogodinho/archive/2009/07/06/interesting-reading-about-entity-framework-4-0.aspx</link><pubDate>Mon, 06 Jul 2009 05:00:00 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1698491</guid><dc:creator>NunoGodinho</dc:creator><description>&lt;p&gt;Entity Framework has suffered great changes and in order to know more about them I recommend the following reading:&lt;/p&gt;  &lt;p&gt;POCO (&lt;strong&gt;P&lt;/strong&gt;lain &lt;strong&gt;O&lt;/strong&gt;ld &lt;strong&gt;C&lt;/strong&gt;LR &lt;strong&gt;O&lt;/strong&gt;bject or Persistence ) in the Entity Framework 4.0&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;&lt;a href="http://blogs.msdn.com/adonet/archive/2009/05/11/sneak-preview-persistence-ignorance-and-poco-in-entity-framework-4-0.aspx" target="_blank"&gt;Sneak Preview: Persistence Ignorance and POCO in Entity Framework 4.0&lt;/a&gt;&lt;/li&gt;    &lt;li&gt;POCO in the Entity Framework: &lt;/li&gt; &lt;/ul&gt;  &lt;blockquote&gt;   &lt;p&gt;“Why is POCO important in Entity Framework? Is important because now we have the ability to really separate the Storage Model from the Conceptual Model, and being the Conceptual Model our &lt;strong&gt;normal&lt;/strong&gt; CLR Objects, that was not possible in previous versions of Entity Framework. This is a huge breakthrough for this 4.0 version. Is not perfect, and in this technologies it never is but it’s very interesting”&lt;/p&gt; &lt;/blockquote&gt;  &lt;ul&gt;   &lt;ol&gt;     &lt;li&gt;&lt;a href="http://blogs.msdn.com/adonet/archive/2009/05/21/poco-in-the-entity-framework-part-1-the-experience.aspx" target="_blank"&gt;Part 1 - The Experience&lt;/a&gt; (Explains how to make this two parts of the POCO experience with Entity Framework 4.0, from making the Model to the designing of the POCO entities, as well as answering some interesting questions)&lt;/li&gt;      &lt;li&gt;&lt;a href="http://blogs.msdn.com/adonet/archive/2009/05/28/poco-in-the-entity-framework-part-2-complex-types-deferred-loading-and-explicit-loading.aspx" target="_blank"&gt;Part 2 – Complex Types, Deferred Loading and Explicit Loading&lt;/a&gt; (Goes further in the POCO entities and make changes shows how to implement Complex Types as well as configuring the Loading by using Deferred/Lazy Loading or Explicit Loading)&lt;/li&gt;      &lt;li&gt;&lt;a href="http://blogs.msdn.com/adonet/archive/2009/06/10/poco-in-the-entity-framework-part-3-change-tracking-with-poco.aspx" target="_blank"&gt;Part 3 – Change Tracking with POCO&lt;/a&gt; (Explains furthermore how the Change Tracking, that is so important in Entity Framework, works in POCO entities and how can it be configured by using Metadata) &lt;/li&gt;   &lt;/ol&gt;    &lt;li&gt;&lt;a href="http://blogs.msdn.com/adonet/archive/2009/06/16/using-repository-and-unit-of-work-patterns-with-entity-framework-4-0.aspx" target="_blank"&gt;Using Repository and Unit of Work patterns with Entity Framework 4.0&lt;/a&gt; (Explains how to implement common patterns like &lt;a href="http://martinfowler.com/eaaCatalog/repository.html" target="_blank"&gt;Repository&lt;/a&gt; and &lt;a href="http://www.martinfowler.com/eaaCatalog/unitOfWork.html" target="_blank"&gt;Unit of Work&lt;/a&gt; using Entity Framework 4.0) &lt;/li&gt;    &lt;li&gt;&lt;a href="http://blogs.msdn.com/adonet/archive/2009/06/22/announcing-entity-framework-feature-ctp-1.aspx" target="_blank"&gt;Entity Framework Feature CTP 1&lt;/a&gt; (Announcement of the Entity Framework CTP Features for .NET 4.0 Beta 1)&lt;/li&gt;    &lt;ul&gt;     &lt;li&gt;&lt;a href="http://blogs.msdn.com/adonet/pages/feature-ctp-walkthrough-self-tracking-entities-for-the-entity-framework.aspx" target="_blank"&gt;Feature CTP Walkthrough: Self Tracking Entities for Entity Framework&lt;/a&gt; (Explains the scenarios on where to use the Self Tracking Entities)&lt;/li&gt;      &lt;li&gt;&lt;a href="http://blogs.msdn.com/adonet/pages/feature-ctp-walkthrough-poco-templates-for-the-entity-framework.aspx" target="_blank"&gt;Feature CTP Walkthrough: POCO Templates for Entity Framework&lt;/a&gt; (Explains how to use POCO Templates, that is a kind of T4 Template in order to generate POCO entities)&lt;/li&gt;      &lt;li&gt;&lt;a href="http://blogs.msdn.com/adonet/pages/feature-ctp-walkthrough-code-only-for-the-entity-framework.aspx" target="_blank"&gt;Feature CTP Walkthrough: Code Only for Entity Framework&lt;/a&gt; (Explains how to Entity Framework without any model like EDMX, just code)&lt;/li&gt;   &lt;/ul&gt; &lt;/ul&gt;  &lt;p&gt;I hope you enjoy the reading.&lt;/p&gt;</description></item><item><title>Entity Framework resources</title><link>http://msmvps.com/blogs/brianmadsen/archive/2009/05/08/entity-framework-resources.aspx</link><pubDate>Fri, 08 May 2009 05:00:00 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1692046</guid><dc:creator>BrianMadsen</dc:creator><description>&lt;p&gt;Since i’m getting quite a few questions about Zain Naboulsi’s &lt;a href="http://www.perthsqlserver.com/Meetings/Zain-Naboulsi---What-the-heck-is-the-Entity-Framew.aspx" target="_blank"&gt;presentation to the Perth SQL Server User Group&lt;/a&gt; and requests for more resources, i thought i’d put up a few more which &lt;a href="http://blogs.msdn.com/zainnab/archive/2009/05/03/random-techness-some-entity-framework-resources-for-learning-and-training.aspx" target="_blank"&gt;Zain&lt;/a&gt; just blogged earlier in May.&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;&lt;a href="http://blogs.msdn.com/adonet/archive/tags/Providers/default.aspx"&gt;http://blogs.msdn.com/adonet/archive/tags/Providers/default.aspx&lt;/a&gt;&lt;/li&gt;    &lt;li&gt;&lt;a href="http://thedatafarm.com/LearnEntityFramework/resources/"&gt;http://thedatafarm.com/LearnEntityFramework/resources/&lt;/a&gt;&lt;/li&gt;    &lt;li&gt;&lt;a href="http://blogs.msdn.com/sceppa/"&gt;http://blogs.msdn.com/sceppa/&lt;/a&gt;&lt;/li&gt;    &lt;li&gt;&lt;a href="http://blogs.msdn.com/efdesign/"&gt;http://blogs.msdn.com/efdesign/&lt;/a&gt;&lt;/li&gt;    &lt;li&gt;&lt;a href="http://channel9.msdn.com/pdc2008/TL20/"&gt;http://channel9.msdn.com/pdc2008/TL20/&lt;/a&gt;&lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;Also, you can download this phenomenal &lt;a href="http://msmvps.com/blogs/brianmadsen/archive/2009/04/10/free-500-page-pdf-on-the-entity-framework.aspx" target="_blank"&gt;500 page PDF&lt;/a&gt; which’ll give you a good tour and introduction to the Entity Framework.&lt;/p&gt;  &lt;p&gt;Zain’s presentation to the PSSUG is also available – &lt;a href="http://www.perthsqlserver.com/News/Zain-Naboulsi---LiveMeeting-recorded-session-avail.aspx" target="_blank"&gt;click here to download&lt;/a&gt;&lt;/p&gt;</description></item><item><title>Free 500 page PDF on the Entity Framework</title><link>http://msmvps.com/blogs/brianmadsen/archive/2009/04/10/free-500-page-pdf-on-the-entity-framework.aspx</link><pubDate>Fri, 10 Apr 2009 05:00:00 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1686482</guid><dc:creator>BrianMadsen</dc:creator><description>&lt;p&gt;Sometimes you get this one shining community star that just goes above and beyond…and sometimes something good comes out of it too :)&lt;/p&gt;  &lt;p&gt;Well, &lt;a href="http://weblogs.asp.net/zeeshanhirani" target="_blank"&gt;Zeeshan Hirani&lt;/a&gt;, from the C# UG in Dallas, released a &lt;a href="http://weblogs.asp.net/zeeshanhirani/archive/2008/12/05/my-christmas-present-to-the-entity-framework-community.aspx" target="_blank"&gt;500 page PDF on the Entity Framework&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt;500???? pages??? &lt;/p&gt;  &lt;p&gt;After having read through it I was pretty amazed – that’s one huge contribution. Not only is the read an excellent introduction to EF, but it’s book publishing quality!!&lt;/p&gt;  &lt;p&gt;I’d recommend Zeeshan consider his options and get a hard cover out there for us “physical fans” that still like the feeling of opening up that technical book.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/zainnab/archive/2009/04/05/contributions-to-entity-framework-community-awesome-500-page-pdf-on-the-ef.aspx" target="_blank"&gt;Zain Naboulsi put me on to this one a few days ago&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt;If you want to have a look at this &lt;a href="http://weblogs.asp.net/zeeshanhirani/archive/2008/12/05/my-christmas-present-to-the-entity-framework-community.aspx" target="_blank"&gt;“e-book”&lt;/a&gt;, head on over and give some kudos to &lt;a href="http://weblogs.asp.net/zeeshanhirani" target="_blank"&gt;Zeeshan&lt;/a&gt; on his blog.&lt;/p&gt;</description></item></channel></rss>