ZZZ Projects, founded by Jonathan Magnan, specializes in developer tools like Entity Framework Extensions for EF Core, Dapper Plus, and C# Eval Expression.
With Dapper you run the application and it crashes because of a bug in SQL string
Here is how to fix it ๐
Dapper is fast and gives you full control over SQL.
But that control comes with a hidden cost.
Every INSERT, UPDATE, and DELETE you write lives inside a string.
And strings have zero type safety.
โณ Rename a column? No compile error.
โณ Change a property type? No compile error.
โณ Misspell a parameter name? No compile error.
You only find out something is broken when your app crashes at runtime.
Here is what most developers do when using Dapper:
โ Write SQL commands as plain strings
โ Map every parameter by hand
โ Repeat the same column lists across Insert, Update, and Delete
โ Hardcode table and schema names everywhere
One small refactor breaks half of your queries.
And the compiler will not save you.
There is a much better way.
In my latest video, I show how to solve this with ๐๐ฎ๐ฝ๐ฝ๐ฒ๐ฟ ๐ฃ๐น๐๐ ๐ ๐ฎ๐ฝ๐ฝ๐ถ๐ป๐ด.
Dapper Plus gives you 3 ways to map your entities to the database - all type-safe.
๐ญ. ๐๐๐๐ผ ๐ ๐ฎ๐ฝ๐ฝ๐ถ๐ป๐ด
โ Zero configuration needed
โ Library matches class name to table name
โ Properties match column names automatically
โ Just call SingleInsert or BulkInsert and it works
๐ฎ. ๐๐ฎ๐๐ฎ ๐๐ป๐ป๐ผ๐๐ฎ๐๐ถ๐ผ๐ป๐
โ Use [Table], [Column], [Key], [NotMapped] attributes
โ Familiar to anyone using EF Core
โ Keeps mapping next to your model
๐ฏ. ๐๐น๐๐ฒ๐ป๐ ๐๐ฃ๐ ๐ ๐ฎ๐ฝ๐ฝ๐ถ๐ป๐ด
โ Full control with strongly-typed lambdas
โ Map only what you need: .Map(x => new { https://t.co/Ihd1gKwJ4f, x.Price })
โ MapAuto method and DapperPlus figures it out for you
โ Refactor-friendly: rename a property and the compiler tells you
You can also organize mappings with ๐๐ฎ๐ฝ๐ฝ๐ฒ๐ฟ ๐ฃ๐น๐๐ ๐๐ผ๐ป๐๐ฒ๐ ๐:
โ Global context - configure once at startup
โ Instance context - configure per use case
โ Inheritance context - reuse mappings across services
And the best part?
The same mapping works for ๐ฏ๐ผ๐๐ต free Single methods ๐ฎ๐ป๐ฑ paid Bulk methods.
No more SQL strings scattered across your codebase.
No more runtime surprises after a refactor.
Just clean, type-safe writes.
Watch the full video and see all 3 mapping approaches in action.
P.S.: You can get a free trial for this library and test for 30 days, and you can extend the trial for another month as needed.
Get started with Dapper Plus Mapping:
https://t.co/DzCnhjbIOo
Here is the source code:
https://t.co/ot8ZPBalcB
How do you solve runtime bugs in SQL strings when using Dapper? Share below ๐
โโ
โป๏ธ Repost to help others write type-safe Dapper queries
โ Follow me ( @anton-martyniuk ) to improve your .NET and Architecture Skills
Many thanks to @zzzprojects for sponsoring this post
This article explores the differences between SqlBulkCopy and Dapper Plus, helping developers understand the trade-offs between flexibility, simplicity, and raw speed.
A great read for anyone looking to optimize bulk operations in .NET ๐
https://t.co/sDikwWw6Cu
@AntonMartyniuk Dapper plus is the best library for bulk operations, super fast and comprehensive. Teams can really benefit from it. Good value for its license. It is an investment for your product.
๐ Important note:
You can use the following methods for free in Dapper Plus:
โ SingleInsert - insert one entity without writing SQL
โ SingleUpdate - update one entity
โ SingleDelete - delete one entity
โ SingleMerge - upsert in one line (insert or update)
โ SingleSynchronize - keep your data in sync with the source
โ CreateTable - create the table directly from your C# class
Get started with Dapper Plus:
https://t.co/NqbG0pEizp
Dapper ๐ต๐ฎ๐ ๐ฎ ๐ฏ๐ถ๐ด ๐ฝ๐ฒ๐ฟ๐ณ๐ผ๐ฟ๐บ๐ฎ๐ป๐ฐ๐ฒ ๐ฝ๐ฒ๐ป๐ฎ๐น๐๐ ๐๐ต๐ฒ๐ป ๐๐ผ๐ insert multiple rows.
Here is how to address this problem ๐
Developers love Dapper for blazing-fast reads.
But for inserting or updating many rows, it becomes painfully slow (even slower than EF Core).
But Why?
Dapper sends each row to the database one by one.
10,000 rows = 10,000 round-trips.
And here is another problem:
โณ You need to write a lot of boilerplate code when using Dapper.
Here is what most developers do when using Dapper:
โ Write manual INSERT and UPDATE SQL statements
โ Build complex SQL with hundreds of parameters by hand
โ Write CREATE TABLE scripts
And the problem is that you don't have type safety when writing SQL commands inside strings. When something goes wrong you will only know at runtime.
There is a much better way.
In my latest video, I show how to solve this with ๐๐ฎ๐ฝ๐ฝ๐ฒ๐ฟ ๐ฃ๐น๐๐.
๐ ๐ฆ๐๐ผ๐ฝ ๐ช๐ฟ๐ถ๐๐ถ๐ป๐ด ๐๐ผ๐บ๐ฝ๐น๐ฒ๐ ๐ฆ๐ค๐ ๐๐ผ ๐ฆ๐ฎ๐๐ฒ ๐๐ฎ๐๐ฎ - ๐๐ฒ๐ ๐๐ฎ๐ฝ๐ฝ๐ฒ๐ฟ ๐ฃ๐น๐๐ ๐๐ผ ๐๐ ๐ณ๐ผ๐ฟ ๐ฌ๐ผ๐.
Dapper Plus gives you clean, simple methods for every write operation.
๐๐ฟ๐ฒ๐ฒ ๐ฆ๐ถ๐ป๐ด๐น๐ฒ ๐ ๐ฒ๐๐ต๐ผ๐ฑ๐:
โ SingleInsert - insert one entity without writing SQL
โ SingleUpdate - update one entity
โ SingleDelete - delete one entity
โ SingleMerge - upsert in one line (insert or update)
โ SingleSynchronize - keep your data in sync with the source
โ CreateTable - create the table directly from your C# class
No more manual SQL.
No more parameter mapping by hand.
Just call the method and Dapper Plus handles the rest.
All single methods are ๐ณ๐ฟ๐ฒ๐ฒ ๐๐ผ ๐๐๐ฒ.
๐ฃ๐ฎ๐ถ๐ฑ ๐๐๐น๐ธ ๐ ๐ฒ๐๐ต๐ผ๐ฑ๐ (for high performance):
โ BulkInsert
โ BulkUpdate
โ BulkDelete
โ BulkMerge
โ BulkSynchronize
This is where the real magic happens.
I inserted 10,000 product records into the database:
โ Dapper: 7,000 ms
โ Dapper Plus BulkInsert: 300 ms
That is over ๐ต๐ฒ% ๐ณ๐ฎ๐๐๐ฒ๐ฟ with a single line of code.
Dapper Plus supports SQL Server, PostgreSQL, MySQL, Oracle, MariaDB, and SQLite.
Watch the full video and see every method in action.
P.S.: You can get a free trial for this library and test for 30 days, and you can extend the trial for another month as needed.
Get started with Dapper Plus:
https://t.co/36eO749haH
Here is the source code:
https://t.co/ot8ZPBalcB
How do you currently handle bulk inserts in Dapper? Share below ๐
โโ
โป๏ธ Repost to help others speed up their Dapper write queries
โ Follow me ( @AntonMartyniuk ) to improve your .NET and Architecture Skills
Many thanks to @zzzprojects for sponsoring this post
๐ New video from Anton Martyniuk about improving Dapper performance with Dapper Plus!
If you're working with Dapper and handling large amounts of data, this video is worth watching.
๐ฅ Watch the video:
https://t.co/rETR5H6dZO
#dotnet#dapper#csharp#sqlserver#programming
๐ New article by Anton Martyniuk
๐ https://t.co/GGdEkq5til
Returning identity values in EF Core isnโt as simple as it looks.
A quick, insightful read on what happens under the hood and when it really matters ๐
#dotnet#efcore#csharp
๐ Sharing a great video on Entity Framework Extensions!
If you're working with Entity Framework Core and looking to boost performance, especially for bulk operations, this is definitely worth a watch.
๐ฅ https://t.co/cKIZPUxn6j
๐ฌ New video is live!
LINQ Dynamic vs C# Eval Expression: Which One Should You Use?
Anton Martyniuk walks through key concepts and practical examples to help you get up and running.
๐ Watch here: https://t.co/xvHbI7uIBu
New article on YogiHosting!
Learn how to boost your EF Core performance using Entity Framework Extensions for fast bulk operations (insert, update, delete, merge).
๐ https://t.co/pcUBv23BxO
#DotNet#EFCore#EntityFramework#Performance#ZZZProjects
March Monthly Contest Winner
โDefinitely the library is amazing, and is ideal for high-performance scenarios where efficiency and clear data access logic matter most.โ
โ Nelson Solorzano, Freelancer
Thanks for sharing your experience ๐
๐ https://t.co/0xDg5REMRZ
#DotNet#EF
New video in Arabic!
If you're working with Entity Framework, this video is worth checking out.
Youโll learn how to:
โ๏ธ Boost performance
โ๏ธ Reduce execution time
โ๏ธ Handle large datasets more efficiently
Video here: https://t.co/REEgZJUrnF
#dotnet#EntityFramework
๐ New article by Anton Martyniuk
Learn how to get the most out of Entity Framework Extensions by understanding its key options โ from column control to performance tuning.
๐ https://t.co/zPRl5qGvH8
๐ฌ๐ผ๐ ๐๐๐ถ๐น๐น ๐๐ฟ๐ถ๐๐ฒ ๐ฎ ๐ช๐ต๐ฒ๐ฟ๐ฒ + ๐๐ผ๐ป๐๐ฎ๐ถ๐ป๐ ๐ถ๐ป ๐๐ ๐๐ผ๐ฟ๐ฒ?
Please stop! ๐
As you are ruining the performance of your application.
When working with Entity Framework Core, developers often need to retrieve multiple entities from the database based on a collection of IDs or values.
The typical approach is to use the Contains method:
๐๐๐ ๐๐๐๐๐๐๐๐ = ๐๐ ๐๐๐ ๐๐๐ฒ๐๐๐๐๐ก๐.๐ฟ๐๐๐๐๐๐๐
.๐๐๐๐๐(๐ => ๐๐๐๐๐๐๐๐ธ๐๐.๐ฒ๐๐๐๐๐๐๐(๐.๐ธ๐))
.๐๐๐ป๐๐๐๐ฐ๐๐ข๐๐();
This approach works fine for small collections, but it creates significant problems when dealing with large datasets:
โ Performance degradation - Even with proper indexes, the SQL WHERE IN clause becomes slower as the number of parameters increases.
โ Parameter limit exceeded - SQL Server has a hard limit of 2,100 parameters per query. While you can work around this by splitting queries into batches in SQL, this is not always practical when using EF Core, especially in complex scenarios with additional filters and joins.
โ Memory and connection issues - Multiple round-trips to the database consume more memory and keep database connections open longer, potentially causing connection pool exhaustion.
This becomes a real problem in scenarios like synchronizing product catalogs, processing bulk orders, or updating inventory across thousands of items.
There is a better solution: ๐๐ป๐๐ถ๐๐ ๐๐ฟ๐ฎ๐บ๐ฒ๐๐ผ๐ฟ๐ธ ๐๐ ๐๐ฒ๐ป๐๐ถ๐ผ๐ป๐ library provides specialized methods for bulk data retrieval that solve all these problems.
The library provides specialized methods that use temporary tables internally to bypass the parameter limit and improve performance.
In the video, I show a detailed guide to 5 bulk-read methods using the ๐๐ป๐๐ถ๐๐ ๐๐ฟ๐ฎ๐บ๐ฒ๐๐ผ๐ฟ๐ธ ๐๐ ๐๐ฒ๐ป๐๐ถ๐ผ๐ป๐ library.
I explain in depth these methods:
โ WhereBulkContains
โ WhereBulkNotContains
โ BulkRead
โ WhereBulkContainsFilterList
โ WhereBulkNotContainsFilterList
๐ Get the source code of this video:
โณ https://t.co/ux3QAFUCnG
๐ Get started with EF Core Extensions:
โณ https://t.co/NjPzqM4yEz
โโ
โป๏ธ Repost to help others learn how to perform bulk read operations in EF Core
โ Follow me ( @AntonMartyniuk ) to improve your .NET and Architecture Skills
Many thanks to @zzzprojects for sponsoring this post.
In this article, youโll learn how to get started with Entity Framework Extensions and use bulk operations like BulkInsert, BulkUpdate, and BulkMerge to handle large datasets efficiently. https://t.co/9HNgMahA1B
๐ท ZZZ Projects โ February Newsletter
Stay up to date with the latest updates, releases, and community highlights from the ZZZ Projects team!
https://t.co/lD7KVT3PyC
Want to build a fast and clean CRUD API in https://t.co/1c94knt08a Core?
In this new article from Coding Sonata, youโll learn how to combine Dapper for lightweight data access with Dapper Plus for high-performance inserts, updates, and bulk operations.
https://t.co/G79wrntOrd
๐ฅ Sarrawy Dev explains Entity Framework Extensions and how it helps boost performance.
Whether youโre optimizing bulk operations or improving overall efficiency, this video breaks the concepts down in a clear and practical way.
๐ Watch here: https://t.co/VpdJipvMuU
These options in Entity Framework Extensions library (PART 2)
Will save you hours, days or even weeks of development ๐
Entity Framework Extensions library is not only useful when you need to insert thousands of records.
It also comes with hundreds of useful options that can save a lot of time in your daily routine with EF Core.
In the video, I show a detailed guide on various options with ๐๐ป๐๐ถ๐๐ ๐๐ฟ๐ฎ๐บ๐ฒ๐๐ผ๐ฟ๐ธ ๐๐ ๐๐ฒ๐ป๐๐ถ๐ผ๐ป๐ library.
This video is PART 2 in the series.
You can try EF Core Extensions for free with the monthly trial.
๐ Get started with EF Core Extensions:
โณ https://t.co/gv4Eehv5u5
๐ See real-world benchmarks:
โณ https://t.co/JXOKu0A6AY
๐ Get the source code of this video:
โณ https://t.co/nD2NLVS1At
โโ
โป๏ธ Repost to help others save time with EF Core Extensions
โ Follow me ( @AntonMartyniuk ) to improve your .NET and Architecture Skills
Many thanks to @zzzprojects for sponsoring this post.