<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Entity Framework &#8211; Bits of .NET</title>
	<atom:link href="http://blog.ercanopak.com/category/entity-framework/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.ercanopak.com</link>
	<description>Daily micro-tips for C#, SQL, performance, and scalable backend engineering.</description>
	<lastBuildDate>Sun, 28 Dec 2025 15:21:22 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.4</generator>

<image>
	<url>http://blog.ercanopak.com/wp-content/uploads/2018/06/cropped-EO_LOGO_32-32x32.png</url>
	<title>Entity Framework &#8211; Bits of .NET</title>
	<link>http://blog.ercanopak.com</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>EF Core — Change Tracking Is a Hidden Performance Tax</title>
		<link>http://blog.ercanopak.com/ef-core-change-tracking-is-a-hidden-performance-tax/</link>
					<comments>http://blog.ercanopak.com/ef-core-change-tracking-is-a-hidden-performance-tax/#respond</comments>
		
		<dc:creator><![CDATA[ErcanOPAK]]></dc:creator>
		<pubDate>Sun, 28 Dec 2025 15:21:22 +0000</pubDate>
				<category><![CDATA[C#]]></category>
		<category><![CDATA[Entity Framework]]></category>
		<category><![CDATA[efcore]]></category>
		<category><![CDATA[orm]]></category>
		<category><![CDATA[performance]]></category>
		<guid isPermaLink="false">http://blog.ercanopak.com/?p=50587</guid>

					<description><![CDATA[Tracking thousands of entities slows everything. ✅ Fix context.ChangeTracker.QueryTrackingBehavior = NoTracking; Or per query: .AsNoTracking() &#160;]]></description>
										<content:encoded><![CDATA[<p data-start="1004" data-end="1052">Tracking thousands of entities slows everything.</p>
<h3 data-start="1054" data-end="1063"><img src="https://s.w.org/images/core/emoji/17.0.2/72x72/2705.png" alt="✅" class="wp-smiley" style="height: 1em; max-height: 1em;" /> Fix</h3>
<pre class="EnlighterJSRAW" data-enlighter-language="csharp">context.ChangeTracker.QueryTrackingBehavior = NoTracking;
</pre>
<p>Or per query:</p>
<pre class="EnlighterJSRAW" data-enlighter-language="csharp">.AsNoTracking()
</pre>
<p>&nbsp;</p>
]]></content:encoded>
					
					<wfw:commentRss>http://blog.ercanopak.com/ef-core-change-tracking-is-a-hidden-performance-tax/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Stop Calling ToList() Too Early – Improve LINQ Performance</title>
		<link>http://blog.ercanopak.com/stop-calling-tolist-too-early-improve-linq-performance/</link>
		
		<dc:creator><![CDATA[ErcanOPAK]]></dc:creator>
		<pubDate>Thu, 04 Dec 2025 09:00:00 +0000</pubDate>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[Asp.Net Core]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[Entity Framework]]></category>
		<category><![CDATA[csharp]]></category>
		<category><![CDATA[dotnet-core]]></category>
		<guid isPermaLink="false">https://example.com/?p=10010</guid>

					<description><![CDATA[Calling ToList() too early forces premature execution. // Bad var items = db.Users.ToList().Where(...); // Good var items = db.Users.Where(...).ToList(); &#160; Let the database handle filtering and execution.]]></description>
										<content:encoded><![CDATA[<p>Calling ToList() too early forces premature execution.</p>
<pre class="EnlighterJSRAW" data-enlighter-language="csharp">// Bad
var items = db.Users.ToList().Where(...);

// Good
var items = db.Users.Where(...).ToList();</pre>
<p>&nbsp;</p>
<p>Let the database handle filtering and execution.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>How to get rows count in EntityFramework without loading contents</title>
		<link>http://blog.ercanopak.com/how-to-get-rows-count-in-entityframework-without-loading-contents/</link>
					<comments>http://blog.ercanopak.com/how-to-get-rows-count-in-entityframework-without-loading-contents/#respond</comments>
		
		<dc:creator><![CDATA[ErcanOPAK]]></dc:creator>
		<pubDate>Tue, 20 Jun 2023 09:23:59 +0000</pubDate>
				<category><![CDATA[ASP.Net MVC]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[Entity Framework]]></category>
		<category><![CDATA[content]]></category>
		<category><![CDATA[count]]></category>
		<category><![CDATA[EF]]></category>
		<category><![CDATA[entity]]></category>
		<category><![CDATA[entity framework]]></category>
		<category><![CDATA[loading]]></category>
		<category><![CDATA[method]]></category>
		<category><![CDATA[query]]></category>
		<category><![CDATA[row]]></category>
		<category><![CDATA[without loading]]></category>
		<guid isPermaLink="false">http://blog.ercanopak.com/?p=980</guid>

					<description><![CDATA[Query syntax: var count = (from t in context.MyTable where t.Id == @Id select t).Count(); Method syntax: var count = context.MyTable .Where(t =&#62; t.Id == @Id) .Count() Both generate the same SQL query.]]></description>
										<content:encoded><![CDATA[<p>Query syntax:</p>
<blockquote>
<pre class="lang-cs s-code-block"><code class="hljs language-csharp"><span class="hljs-keyword">var</span> count = (<span class="hljs-keyword">from</span> t <span class="hljs-keyword">in</span> context.MyTable
             <span class="hljs-keyword">where</span> t.Id == <span class="hljs-string">@Id</span>
             <span class="hljs-keyword">select</span> t).Count();
</code></pre>
</blockquote>
<p>Method syntax:</p>
<blockquote>
<pre class="lang-cs s-code-block"><code class="hljs language-csharp"><span class="hljs-keyword">var</span> count = context.MyTable
            .Where(t =&gt; t.Id == <span class="hljs-string">@Id</span>)
            .Count()
</code></pre>
</blockquote>
<p>Both generate the same SQL query.</p>
]]></content:encoded>
					
					<wfw:commentRss>http://blog.ercanopak.com/how-to-get-rows-count-in-entityframework-without-loading-contents/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
