<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Forem: mtyide</title>
    <description>The latest articles on Forem by mtyide (@mtyide).</description>
    <link>https://forem.com/mtyide</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F362983%2F3a68db3f-2530-43ea-ad9c-a756d49dbbef.png</url>
      <title>Forem: mtyide</title>
      <link>https://forem.com/mtyide</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/mtyide"/>
    <language>en</language>
    <item>
      <title>[Boost]</title>
      <dc:creator>mtyide</dc:creator>
      <pubDate>Tue, 05 May 2026 12:22:06 +0000</pubDate>
      <link>https://forem.com/mtyide/-2odg</link>
      <guid>https://forem.com/mtyide/-2odg</guid>
      <description>&lt;div class="ltag__link--embedded"&gt;
  &lt;div class="crayons-story "&gt;
  &lt;a href="https://dev.to/mtyide/connecting-to-sql-server-using-dapper-1d7e" class="crayons-story__hidden-navigation-link"&gt;Connecting to SQL Server Using Dapper&lt;/a&gt;


  &lt;div class="crayons-story__body crayons-story__body-full_post"&gt;
    &lt;div class="crayons-story__top"&gt;
      &lt;div class="crayons-story__meta"&gt;
        &lt;div class="crayons-story__author-pic"&gt;

          &lt;a href="/mtyide" class="crayons-avatar  crayons-avatar--l  "&gt;
            &lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F362983%2F3a68db3f-2530-43ea-ad9c-a756d49dbbef.png" alt="mtyide profile" class="crayons-avatar__image" width="420" height="420"&gt;
          &lt;/a&gt;
        &lt;/div&gt;
        &lt;div&gt;
          &lt;div&gt;
            &lt;a href="/mtyide" class="crayons-story__secondary fw-medium m:hidden"&gt;
              mtyide
            &lt;/a&gt;
            &lt;div class="profile-preview-card relative mb-4 s:mb-0 fw-medium hidden m:inline-block"&gt;
              
                mtyide
                
              
              &lt;div id="story-author-preview-content-3614055" class="profile-preview-card__content crayons-dropdown branded-7 p-4 pt-0"&gt;
                &lt;div class="gap-4 grid"&gt;
                  &lt;div class="-mt-4"&gt;
                    &lt;a href="/mtyide" class="flex"&gt;
                      &lt;span class="crayons-avatar crayons-avatar--xl mr-2 shrink-0"&gt;
                        &lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F362983%2F3a68db3f-2530-43ea-ad9c-a756d49dbbef.png" class="crayons-avatar__image" alt="" width="420" height="420"&gt;
                      &lt;/span&gt;
                      &lt;span class="crayons-link crayons-subtitle-2 mt-5"&gt;mtyide&lt;/span&gt;
                    &lt;/a&gt;
                  &lt;/div&gt;
                  &lt;div class="print-hidden"&gt;
                    
                      Follow
                    
                  &lt;/div&gt;
                  &lt;div class="author-preview-metadata-container"&gt;&lt;/div&gt;
                &lt;/div&gt;
              &lt;/div&gt;
            &lt;/div&gt;

          &lt;/div&gt;
          &lt;a href="https://dev.to/mtyide/connecting-to-sql-server-using-dapper-1d7e" class="crayons-story__tertiary fs-xs"&gt;&lt;time&gt;May 5&lt;/time&gt;&lt;span class="time-ago-indicator-initial-placeholder"&gt;&lt;/span&gt;&lt;/a&gt;
        &lt;/div&gt;
      &lt;/div&gt;

    &lt;/div&gt;

    &lt;div class="crayons-story__indention"&gt;
      &lt;h2 class="crayons-story__title crayons-story__title-full_post"&gt;
        &lt;a href="https://dev.to/mtyide/connecting-to-sql-server-using-dapper-1d7e" id="article-link-3614055"&gt;
          Connecting to SQL Server Using Dapper
        &lt;/a&gt;
      &lt;/h2&gt;
        &lt;div class="crayons-story__tags"&gt;
            &lt;a class="crayons-tag  crayons-tag--monochrome " href="/t/dapper"&gt;&lt;span class="crayons-tag__prefix"&gt;#&lt;/span&gt;dapper&lt;/a&gt;
            &lt;a class="crayons-tag  crayons-tag--monochrome " href="/t/sqlserver"&gt;&lt;span class="crayons-tag__prefix"&gt;#&lt;/span&gt;sqlserver&lt;/a&gt;
            &lt;a class="crayons-tag  crayons-tag--monochrome " href="/t/netcore"&gt;&lt;span class="crayons-tag__prefix"&gt;#&lt;/span&gt;netcore&lt;/a&gt;
            &lt;a class="crayons-tag  crayons-tag--monochrome " href="/t/vscode"&gt;&lt;span class="crayons-tag__prefix"&gt;#&lt;/span&gt;vscode&lt;/a&gt;
        &lt;/div&gt;
      &lt;div class="crayons-story__bottom"&gt;
        &lt;div class="crayons-story__details"&gt;
          &lt;a href="https://dev.to/mtyide/connecting-to-sql-server-using-dapper-1d7e" class="crayons-btn crayons-btn--s crayons-btn--ghost crayons-btn--icon-left"&gt;
            &lt;div class="multiple_reactions_aggregate"&gt;
              &lt;span class="multiple_reactions_icons_container"&gt;
                  &lt;span class="crayons_icon_container"&gt;
                    &lt;img src="https://assets.dev.to/assets/fire-f60e7a582391810302117f987b22a8ef04a2fe0df7e3258a5f49332df1cec71e.svg" width="24" height="24"&gt;
                  &lt;/span&gt;
              &lt;/span&gt;
              &lt;span class="aggregate_reactions_counter"&gt;1&lt;span class="hidden s:inline"&gt; reaction&lt;/span&gt;&lt;/span&gt;
            &lt;/div&gt;
          &lt;/a&gt;
            &lt;a href="https://dev.to/mtyide/connecting-to-sql-server-using-dapper-1d7e#comments" class="crayons-btn crayons-btn--s crayons-btn--ghost crayons-btn--icon-left flex items-center"&gt;
              Comments


              &lt;span class="hidden s:inline"&gt;Add Comment&lt;/span&gt;
            &lt;/a&gt;
        &lt;/div&gt;
        &lt;div class="crayons-story__save"&gt;
          &lt;small class="crayons-story__tertiary fs-xs mr-2"&gt;
            2 min read
          &lt;/small&gt;
            
              &lt;span class="bm-initial"&gt;
                

              &lt;/span&gt;
              &lt;span class="bm-success"&gt;
                

              &lt;/span&gt;
            
        &lt;/div&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;/div&gt;


</description>
    </item>
    <item>
      <title>Connecting to SQL Server Using Dapper</title>
      <dc:creator>mtyide</dc:creator>
      <pubDate>Tue, 05 May 2026 09:43:10 +0000</pubDate>
      <link>https://forem.com/mtyide/connecting-to-sql-server-using-dapper-1d7e</link>
      <guid>https://forem.com/mtyide/connecting-to-sql-server-using-dapper-1d7e</guid>
      <description>&lt;p&gt;Connecting to SQL Server with the Dapper framework is one of the simplest and fastest ways to work with databases in .NET. Dapper is a lightweight ORM (Object-Relational Mapper) created by Stack Overflow, designed for performance and minimal abstraction—ideal if you want control over your SQL while avoiding boilerplate code.&lt;/p&gt;

&lt;h2&gt;
  
  
  How to Connect to SQL Server Using Dapper
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;1. What You Need&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Before getting started, make sure you have:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A .NET project (e.g., .NET 6 or later)&lt;/li&gt;
&lt;li&gt;SQL Server installed (local or remote)&lt;/li&gt;
&lt;li&gt;NuGet packages:
&lt;em&gt;Dapper,
Microsoft.Data.SqlClient&lt;/em&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;You can install them via NuGet:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;dotnet add package Dapper
dotnet add package Microsoft.Data.SqlClient
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;2. Create a Connection String&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;A typical SQL Server connection string looks like:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight csharp"&gt;&lt;code&gt;&lt;span class="kt"&gt;string&lt;/span&gt; &lt;span class="n"&gt;connectionString&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"Server=localhost;Database=YourDb;Trusted_Connection=True;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Or with SQL authentication:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight csharp"&gt;&lt;code&gt;&lt;span class="kt"&gt;string&lt;/span&gt; &lt;span class="n"&gt;connectionString&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"Server=localhost;Database=YourDb;User Id=yourUser;Password=yourPassword;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;3. Open a Connection&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Dapper works on top of ADO.NET, so you use SqlConnection:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight csharp"&gt;&lt;code&gt;&lt;span class="k"&gt;using&lt;/span&gt; &lt;span class="nn"&gt;Microsoft.Data.SqlClient&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;using&lt;/span&gt; &lt;span class="nn"&gt;System.Data&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="n"&gt;IDbConnection&lt;/span&gt; &lt;span class="n"&gt;db&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nf"&gt;SqlConnection&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;connectionString&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;4. Execute a Simple Query&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Here’s how to fetch data:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight csharp"&gt;&lt;code&gt;&lt;span class="k"&gt;using&lt;/span&gt; &lt;span class="nn"&gt;Dapper&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kt"&gt;var&lt;/span&gt; &lt;span class="n"&gt;users&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="n"&gt;db&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Query&lt;/span&gt;&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;User&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;(&lt;/span&gt;&lt;span class="s"&gt;"SELECT * FROM Users"&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;ToList&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Dapper automatically maps columns to your C# class:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight csharp"&gt;&lt;code&gt;&lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;User&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;Id&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="k"&gt;get&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="k"&gt;set&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="kt"&gt;string&lt;/span&gt; &lt;span class="n"&gt;Name&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="k"&gt;get&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="k"&gt;set&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;5. Parameterized Queries (Important for Safety)&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Avoid SQL injection by using parameters:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight csharp"&gt;&lt;code&gt;&lt;span class="kt"&gt;var&lt;/span&gt; &lt;span class="n"&gt;user&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="n"&gt;db&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;QuerySingleOrDefault&lt;/span&gt;&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;User&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;(&lt;/span&gt;
    &lt;span class="s"&gt;"SELECT * FROM Users WHERE Id = @Id"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;Id&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="m"&gt;1&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;6. Insert Data&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight csharp"&gt;&lt;code&gt;&lt;span class="kt"&gt;var&lt;/span&gt; &lt;span class="n"&gt;rowsAffected&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="n"&gt;db&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;Execute&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="s"&gt;"INSERT INTO Users (Name) VALUES (@Name)"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;Name&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"John"&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;7. Async Support (Recommended)&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Dapper supports async operations:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight csharp"&gt;&lt;code&gt;&lt;span class="kt"&gt;var&lt;/span&gt; &lt;span class="n"&gt;users&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="n"&gt;db&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;QueryAsync&lt;/span&gt;&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;User&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;(&lt;/span&gt;&lt;span class="s"&gt;"SELECT * FROM Users"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Useful Online Resources&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Here are solid free learning materials to go deeper:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Official GitHub repo: &lt;a href="https://github.com/DapperLib/Dapper" rel="noopener noreferrer"&gt;https://github.com/DapperLib/Dapper&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Microsoft SQL Client docs: &lt;a href="https://learn.microsoft.com/sql/connect/ado-net/" rel="noopener noreferrer"&gt;https://learn.microsoft.com/sql/connect/ado-net/&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Dapper tutorial (step-by-step): &lt;a href="https://www.learndapper.com/" rel="noopener noreferrer"&gt;https://www.learndapper.com/&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;SQL Server basics: &lt;a href="https://learn.microsoft.com/sql/sql-server/" rel="noopener noreferrer"&gt;https://learn.microsoft.com/sql/sql-server/&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Why Use Dapper?&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Extremely fast (close to raw SQL performance)&lt;/li&gt;
&lt;li&gt;Minimal learning curve&lt;/li&gt;
&lt;li&gt;Full control over SQL queries&lt;/li&gt;
&lt;li&gt;Lightweight (no heavy ORM overhead like Entity Framework)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Thrifty Tip&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;If you're experimenting locally, you don’t need to pay for SQL Server—use:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;SQL Server Express (completely free)&lt;/li&gt;
&lt;li&gt;Or a free cloud tier from providers like Azure&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Published by &lt;a href="https://www.techm.co.za/" rel="noopener noreferrer"&gt;Techm Studios Pty Ltd&lt;/a&gt;, South Africa&lt;/p&gt;

</description>
      <category>dapper</category>
      <category>sqlserver</category>
      <category>netcore</category>
      <category>vscode</category>
    </item>
    <item>
      <title>Dapper vs. Entity Framework Core: An In-Depth Comparison</title>
      <dc:creator>mtyide</dc:creator>
      <pubDate>Mon, 04 May 2026 05:57:12 +0000</pubDate>
      <link>https://forem.com/mtyide/dapper-vs-entity-framework-core-an-in-depth-comparison-765</link>
      <guid>https://forem.com/mtyide/dapper-vs-entity-framework-core-an-in-depth-comparison-765</guid>
      <description>&lt;h2&gt;
  
  
  Dapper vs. Entity Framework
&lt;/h2&gt;

&lt;p&gt;When building data-driven applications in .NET, two of the most popular data access technologies are &lt;strong&gt;Dapper and Entity Framework Core (EF Core)&lt;/strong&gt;. While both serve the same fundamental purpose—interacting with databases—they take very different approaches. Choosing between them depends heavily on your performance needs, development style, and project complexity.&lt;/p&gt;

&lt;p&gt;Let’s break down how they compare and where each one shines.&lt;/p&gt;

&lt;h2&gt;
  
  
  What Are They?
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Dapper:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Dapper is a &lt;strong&gt;micro-ORM (Object-Relational Mapper)&lt;/strong&gt; created by Stack Overflow. It focuses on &lt;strong&gt;speed and simplicity&lt;/strong&gt;, acting as a lightweight wrapper over raw SQL queries.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;You write SQL manually&lt;/li&gt;
&lt;li&gt;Minimal abstraction&lt;/li&gt;
&lt;li&gt;Extremely fast performance&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Entity Framework Core (EF Core):&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;EF Core is a &lt;strong&gt;full-featured ORM&lt;/strong&gt; developed by Microsoft. It allows developers to interact with databases using C# objects instead of SQL.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Uses LINQ queries:&lt;/li&gt;
&lt;li&gt;Supports change tracking, migrations, and relationships&lt;/li&gt;
&lt;li&gt;Abstracts much of the database layer&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Performance Comparison:&lt;/strong&gt;&lt;br&gt;
Dapper: Built for Speed&lt;br&gt;
Dapper is widely known for being &lt;strong&gt;one of the fastest data access tools&lt;/strong&gt; in .NET.&lt;/p&gt;

&lt;p&gt;Why?&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Minimal overhead&lt;/li&gt;
&lt;li&gt;No change tracking&lt;/li&gt;
&lt;li&gt;Executes raw SQL directly&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Best for:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;High-performance APIs&lt;/li&gt;
&lt;li&gt;Real-time systems&lt;/li&gt;
&lt;li&gt;Applications where every millisecond matters&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;
  
  
  EF Core: Slightly Slower, But Smarter
&lt;/h2&gt;

&lt;p&gt;EF Core introduces overhead due to:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Change tracking&lt;/li&gt;
&lt;li&gt;Query translation (LINQ → SQL)&lt;/li&gt;
&lt;li&gt;Object materialization&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;That said, EF Core has improved significantly in recent versions and is &lt;strong&gt;fast enough for most applications&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Best for:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Complex business logic&lt;/li&gt;
&lt;li&gt;Rapid development&lt;/li&gt;
&lt;li&gt;Maintainability over raw speed&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Developer Experience&lt;/strong&gt;&lt;br&gt;
&lt;strong&gt;EF Core: Productivity Powerhouse&lt;/strong&gt;&lt;br&gt;
EF Core excels in developer productivity.&lt;/p&gt;

&lt;p&gt;Benefits:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Strong typing with LINQ&lt;/li&gt;
&lt;li&gt;Built-in migrations&lt;/li&gt;
&lt;li&gt;Automatic relationship handling&lt;/li&gt;
&lt;li&gt;Change tracking&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;You can write queries like:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight csharp"&gt;&lt;code&gt;&lt;span class="kt"&gt;var&lt;/span&gt; &lt;span class="n"&gt;users&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="n"&gt;context&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Users&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;Where&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;u&lt;/span&gt; &lt;span class="p"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;u&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;IsActive&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;ToList&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;span class="n"&gt;Instead&lt;/span&gt; &lt;span class="n"&gt;of&lt;/span&gt; &lt;span class="n"&gt;raw&lt;/span&gt; &lt;span class="n"&gt;SQL&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Dapper: Full Control, More Responsibility&lt;/strong&gt;&lt;br&gt;
With Dapper, you write SQL directly:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="n"&gt;var&lt;/span&gt; &lt;span class="n"&gt;users&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;connection&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Query&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="k"&gt;User&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;"SELECT * FROM Users WHERE IsActive = 1"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Pros:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Total control over queries&lt;/li&gt;
&lt;li&gt;No hidden SQL generation&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Cons:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;More boilerplate&lt;/li&gt;
&lt;li&gt;Higher chance of human error&lt;/li&gt;
&lt;li&gt;Harder to maintain large systems&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Flexibility &amp;amp; Control&lt;/strong&gt;&lt;br&gt;
&lt;strong&gt;Dapper: Maximum Control&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;You control every query&lt;/li&gt;
&lt;li&gt;Easy to optimize performance&lt;/li&gt;
&lt;li&gt;Works well with stored procedures&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Tradeoff&lt;/strong&gt;: You must manage relationships and mapping manually.&lt;/p&gt;

&lt;p&gt;EF Core: Convention Over Configuration&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Handles joins, relationships, and navigation properties&lt;/li&gt;
&lt;li&gt;Abstracts SQL complexity&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Tradeoff&lt;/strong&gt;: Less transparency into generated SQL (though logging helps)&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Use Case Scenarios&lt;/strong&gt;&lt;br&gt;
&lt;strong&gt;When to Choose Dapper&lt;/strong&gt;&lt;br&gt;
Choose Dapper if:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;You need &lt;strong&gt;maximum performance&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;Your queries are complex and highly optimized&lt;/li&gt;
&lt;li&gt;You prefer &lt;strong&gt;full SQL control&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;You're building &lt;strong&gt;microservices or APIs&lt;/strong&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Example:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Financial trading systems&lt;/li&gt;
&lt;li&gt;High-throughput APIs&lt;/li&gt;
&lt;li&gt;Reporting systems&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;When to Choose EF Core&lt;/strong&gt;&lt;br&gt;
Choose EF Core if:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;You want rapid development&lt;/li&gt;
&lt;li&gt;Your app has complex relationships&lt;/li&gt;
&lt;li&gt;You need maintainability and scalability&lt;/li&gt;
&lt;li&gt;You prefer working with C# over SQL&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Example:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Enterprise applications&lt;/li&gt;
&lt;li&gt;CRUD-heavy systems&lt;/li&gt;
&lt;li&gt;SaaS platforms&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Can You Use Both?
&lt;/h2&gt;

&lt;p&gt;Yes—and many teams do.&lt;/p&gt;

&lt;p&gt;A hybrid approach is common:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Use &lt;strong&gt;EF Core&lt;/strong&gt; for most operations&lt;/li&gt;
&lt;li&gt;Use &lt;strong&gt;Dapper&lt;/strong&gt; for performance-critical queries&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This gives you:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Productivity + Performance&lt;/li&gt;
&lt;li&gt;Clean architecture + optimization where needed&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Key Benefits Summary
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Dapper Advantages&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Blazing fast &lt;/li&gt;
&lt;li&gt;Full SQL control&lt;/li&gt;
&lt;li&gt;Minimal overhead&lt;/li&gt;
&lt;li&gt;Great for performance-critical apps&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;EF Core Advantages&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;High productivity&lt;/li&gt;
&lt;li&gt;Rich feature set&lt;/li&gt;
&lt;li&gt;Easier maintenance&lt;/li&gt;
&lt;li&gt;Built-in migrations and tracking&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Final Verdict
&lt;/h2&gt;

&lt;p&gt;There’s no universal “better” choice—it depends on your priorities:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;If &lt;strong&gt;performance is king&lt;/strong&gt;, go with Dapper&lt;/li&gt;
&lt;li&gt;If &lt;strong&gt;developer productivity and maintainability matter most&lt;/strong&gt;, choose EF Core&lt;/li&gt;
&lt;li&gt;If you want the best of both worlds, &lt;strong&gt;combine them strategically&lt;/strong&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Final Perspective
&lt;/h2&gt;

&lt;p&gt;At &lt;a href="https://www.techmstudios.co.za" rel="noopener noreferrer"&gt;Techm Studios&lt;/a&gt;, the philosophy isn’t about choosing one framework over another—it’s about choosing the &lt;strong&gt;right tool for the &lt;a href="https://www.techm.co.za/jobs" rel="noopener noreferrer"&gt;job&lt;/a&gt;&lt;/strong&gt;. Every system has unique requirements, and the goal is always to align technology decisions with &lt;strong&gt;business needs, scalability goals, and performance expectations&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Whether that means leveraging the raw speed of Dapper, the productivity of EF Core, or a hybrid of both, the focus remains on delivering &lt;strong&gt;fast, secure, and reliable database interactions&lt;/strong&gt; without compromising maintainability.&lt;/p&gt;

</description>
      <category>csharp</category>
      <category>database</category>
      <category>dotnet</category>
      <category>performance</category>
    </item>
  </channel>
</rss>
