<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/bulk-update-with-ef-core-and-dapper-in-net-f73kgiqjg" -->

---
title: Bulk Update with EF Core and Dapper in .NET | daily.dev
description: Comparing approaches for bulk updating large datasets in .NET: loading entities into memory with EF Core and saving changes, raw SQL execution, EF Core's...
canonical: https://daily.dev/posts/bulk-update-with-ef-core-and-dapper-in-net-f73kgiqjg
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: Bulk Update with EF Core and Dapper in .NET | daily.dev
og:description: Comparing approaches for bulk updating large datasets in .NET: loading entities into memory with EF Core and saving changes, raw SQL execution, EF Core's...
og:url: https://daily.dev/posts/bulk-update-with-ef-core-and-dapper-in-net-f73kgiqjg
og:image: https://api.daily.dev/og/posts/f73kGIqjg.png
og:image:alt: Bulk Update with EF Core and Dapper in .NET
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Bulk Update with EF Core and Dapper in .NET

**[NikolaTech](https://daily.dev/sources/nikolatech)** · 5 min read · 0 upvotes · 0 comments

## Summary

Comparing approaches for bulk updating large datasets in .NET: loading entities into memory with EF Core and saving changes, raw SQL execution, EF Core's ExecuteUpdate, and Dapper. BenchmarkDotNet results on 100,000 rows show the naive fetch-and-update-all approach takes 577ms and allocates over 50MB, while raw SQL, Dapper, and ExecuteUpdate all complete in roughly 63-66ms with minimal allocation. ExecuteUpdate is highlighted as a clean, nearly-as-fast alternative to raw SQL that avoids bypassing EF Core entirely. A follow-up post is teased covering third-party bulk operation NuGet packages for even higher performance.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://nikolatech.net/blogs/bulk-update-ef-core-dapper-dotnet>

## Questions this post answers

### How does EF Core's ExecuteUpdate performance compare to raw SQL and Dapper for bulk updates?

Benchmarking 100,000 rows showed EF Core's ExecuteUpdate took about 66ms with 2.71 kB allocated, nearly matching raw SQL at 63.32ms and Dapper at 63.22ms, both allocating around 2.5-2.84 kB. In contrast, fetching all entities and updating them one by one with SaveChangesAsync took 577ms and allocated over 51,580 kB, making ExecuteUpdate a clean, nearly as fast alternative to raw SQL.

_Developers choosing between EF Core and Dapper for bulk updates can compare benchmarked trade-offs on daily.dev._

### Why is fetching all entities with EF Core and saving changes slow for bulk updates?

Loading every row into memory, mutating each tracked entity, and calling SaveChangesAsync forces EF Core's change tracker to monitor and persist each entity individually, which is fine for a few records but scales poorly. In a benchmark on 100,000 rows this approach took 577.26 ms and allocated over 51,580 kB, roughly 9 times slower and far more memory-hungry than ExecuteUpdate, raw SQL, or Dapper.

_Anyone optimizing slow EF Core update loops can weigh faster alternatives surfaced on daily.dev._

## Similar posts on daily.dev

- [Milan Jovanović](https://daily.dev/posts/milan-jovanovi--lmrqyshnk) · Milan Jovanović · 2 upvotes · 0 comments
- [Fastest Way to Bulk Insert Thousands of Rows in EF Core](https://daily.dev/posts/fastest-way-to-bulk-insert-thousands-of-rows-in-ef-core-uym6xxs1m) · Code with Mukesh · 8 upvotes · 2 comments
- [How to Delete and Update Millions of Rows in EF Core Without Loading a Single Entity - Chris Woody Woodruff](https://daily.dev/posts/how-to-delete-and-update-millions-of-rows-in-ef-core-without-loading-a-single-entity---chris-woody-w-axftumts9) · We Are .NET · 0 upvotes · 0 comments

---

Tags: [#database](https://daily.dev/tags/database), [#.net](https://daily.dev/tags/.net), [#c#](https://daily.dev/tags/c#)

[View this post on daily.dev](https://daily.dev/posts/bulk-update-with-ef-core-and-dapper-in-net-f73kgiqjg)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"Bulk Update with EF Core and Dapper in .NET","url":"https://daily.dev/posts/bulk-update-with-ef-core-and-dapper-in-net-f73kgiqjg","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/bulk-update-with-ef-core-and-dapper-in-net-f73kgiqjg"},"datePublished":"2026-10-04T13:06:56.983Z","dateModified":"2026-10-04T13:12:31.192Z","description":"Comparing approaches for bulk updating large datasets in .NET: loading entities into memory with EF Core and saving changes, raw SQL execution, EF Core's...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/a6d92500f8210fe00e8f04b31586efd4?_a=AQAEuop","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/a6d92500f8210fe00e8f04b31586efd4?_a=AQAEuop","isAccessibleForFree":true,"articleSection":"NikolaTech","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"NikolaTech","logo":"https://media.daily.dev/image/upload/s--1h2fO6FL--/f_auto,q_auto/v1791119050/logos/nikolatech?_a=BAMAMicg0","url":"https://daily.dev/sources/nikolatech"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/bulk-update-with-ef-core-and-dapper-in-net-f73kgiqjg","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":0},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"database,.net,c#","timeRequired":"PT5M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"NikolaTech","item":"https://daily.dev/sources/nikolatech"},{"@type":"ListItem","position":3,"name":"Bulk Update with EF Core and Dapper in .NET"}]}
{"@context":"https://schema.org","@type":"FAQPage","@id":"https://daily.dev/posts/bulk-update-with-ef-core-and-dapper-in-net-f73kgiqjg#faq","mainEntity":[{"@type":"Question","name":"How does EF Core's ExecuteUpdate performance compare to raw SQL and Dapper for bulk updates?","acceptedAnswer":{"@type":"Answer","text":"Benchmarking 100,000 rows showed EF Core's ExecuteUpdate took about 66ms with 2.71 kB allocated, nearly matching raw SQL at 63.32ms and Dapper at 63.22ms, both allocating around 2.5-2.84 kB. In contrast, fetching all entities and updating them one by one with SaveChangesAsync took 577ms and allocated over 51,580 kB, making ExecuteUpdate a clean, nearly as fast alternative to raw SQL. Developers choosing between EF Core and Dapper for bulk updates can compare benchmarked trade-offs on daily.dev."}},{"@type":"Question","name":"Why is fetching all entities with EF Core and saving changes slow for bulk updates?","acceptedAnswer":{"@type":"Answer","text":"Loading every row into memory, mutating each tracked entity, and calling SaveChangesAsync forces EF Core's change tracker to monitor and persist each entity individually, which is fine for a few records but scales poorly. In a benchmark on 100,000 rows this approach took 577.26 ms and allocated over 51,580 kB, roughly 9 times slower and far more memory-hungry than ExecuteUpdate, raw SQL, or Dapper. Anyone optimizing slow EF Core update loops can weigh faster alternatives surfaced on daily.dev."}}]}
```

