<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Entity Framework on Strathweb. A free flowing tech monologue.</title>
    <link>https://www.strathweb.com/categories/entity-framework/</link>
    <description>Recent content in Entity Framework on Strathweb. A free flowing tech monologue.</description>
    <generator>Hugo -- gohugo.io</generator>
    <language>en-us</language>
    <lastBuildDate>Fri, 22 Jul 2022 09:29:35 +0000</lastBuildDate><atom:link href="https://www.strathweb.com/categories/entity-framework/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>Subtle breaking change when adding DbContextPool Entity Framework Core 6</title>
      <link>https://www.strathweb.com/2022/07/subtle-breaking-change-when-adding-dbcontextpool-entity-framework-core-6/</link>
      <pubDate>Fri, 22 Jul 2022 09:29:35 +0000</pubDate>
      
      <guid>https://www.strathweb.com/2022/07/subtle-breaking-change-when-adding-dbcontextpool-entity-framework-core-6/</guid>
      <description>&lt;p&gt;During the upgrade process of one of our applications from .NET Core 3.1 to .NET 6.0, I stumbled across a very subtle breaking changing when using the &lt;em&gt;AddDbContextPool()&lt;/em&gt; feature of EF Core. I thought it might be worthwhile to document this, in case someone else is troubled by it too.&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>Serializing Entity Framework objects to JSON in ASP.NET Web API</title>
      <link>https://www.strathweb.com/2012/03/serializing-entity-framework-objects-to-json-in-asp-net-web-api/</link>
      <pubDate>Wed, 21 Mar 2012 23:23:21 +0000</pubDate>
      
      <guid>https://www.strathweb.com/2012/03/serializing-entity-framework-objects-to-json-in-asp-net-web-api/</guid>
      <description>&lt;p&gt;Recently, I&amp;rsquo;ve been playing a lot with ASP.NET Web API, as it is really an exciting technology. It works exceptionally well with JSON.NET (Henrik Nielsen &lt;a href=&#34;http://blogs.msdn.com/b/henrikn/archive/2012/02/18/using-json-net-with-asp-net-web-api.aspx&#34;&gt;wrote a great post&lt;/a&gt; on how to return JSON from ASP.NET Web API using JSON.NET).&lt;/p&gt;
&lt;p&gt;However, as it&amp;rsquo;s been the case in the past with i.e. WCF, I&amp;rsquo;ve run into a issue with serializing Entity Framework object to JSON when returning them from the ApiController. This is not, by any means, an issue in ASP.NET Web API, as the problem in this case lies in the EF lazy loading, which causes circular reference between the objects. This then throws a corresponding error - &amp;ldquo;A circular reference was detected while serializing an object of type (…)&amp;rdquo; if you are using JavaScriptSerializer, &amp;ldquo;Self referencing loop detected for type (…)&amp;rdquo; if you are using JSON.NET and so on.&lt;/p&gt;
&lt;p&gt;I thought it might be useful to remind about possible solutions to this. There is an easy workaround.&lt;/p&gt;
&lt;p&gt;More after the jump.&lt;/p&gt;</description>
    </item>
    
  </channel>
</rss>
