ZZZ Projects (@zzzprojects) header
ZZZ Projects (@zzzprojects) profile picture

ZZZ Projects, founded by Jonathan Magnan, specializes in developer tools like Entity Framework Extensions for EF Core, Dapper Plus, and C# Eval Expression.

Joined February 2014
Photo by ZZZ Projects (@zzzprojects)Photo by ZZZ Projects (@zzzprojects)Photo by ZZZ Projects (@zzzprojects)Photo by ZZZ Projects (@zzzprojects)Photo by ZZZ Projects (@zzzprojects)Photo by ZZZ Projects (@zzzprojects)Photo by ZZZ Projects (@zzzprojects)
Replying to @kristijan_kralj
I don't like SQLBulkCopy. So much code to write, especially when you need to insert related entities. And it's error-prone. And it doesn't work on other databases. I prefer cross-database libraries for bulk writes for EF Core, such as Entity Framework Extensions.
1
1
58
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 { x.Name, 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: dapper-plus.net/mapping?utm_โ€ฆ Here is the source code: github.com/anton-martyniuk/eโ€ฆ 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
7
12
43
5,105
ZZZ Projects retweeted
Replying to @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.
1
1
1
63
๐Ÿ“Œ 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: dapper-plus.net/?utm_source=โ€ฆ
1
2
232
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: dapper-plus.net?utm_source=aโ€ฆ Here is the source code: github.com/anton-martyniuk/eโ€ฆ 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
๐Ÿค Paid partnership
7
8
62
3,145
๐—ฌ๐—ผ๐˜‚ ๐˜€๐˜๐—ถ๐—น๐—น ๐˜„๐—ฟ๐—ถ๐˜๐—ฒ ๐—ฎ ๐—ช๐—ต๐—ฒ๐—ฟ๐—ฒ + ๐—–๐—ผ๐—ป๐˜๐—ฎ๐—ถ๐—ป๐˜€ ๐—ถ๐—ป ๐—˜๐—™ ๐—–๐—ผ๐—ฟ๐—ฒ? 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: โ†ณ github.com/anton-martyniuk/eโ€ฆ ๐Ÿ‘‰ Get started with EF Core Extensions: โ†ณ entityframework-extensions.nโ€ฆ โ€”โ€” โ™ป๏ธ 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.
6
11
69
4,702
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: โ†ณ lnkd.in/djZVdbPY ๐Ÿ‘‰ See real-world benchmarks: โ†ณ lnkd.in/eMD9dAvt ๐Ÿ‘‰ Get the source code of this video: โ†ณ lnkd.in/dkp4XaXG โ€”โ€” โ™ป๏ธ 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.
4
9
48
2,956
These options in Entity Framework Extensions library 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 is the first part of the video, stay tuned for more PART 2 in 2 weeks. You can try EF Core Extensions for free with the monthly trial. ๐Ÿ‘‰ Get started with EF Core Extensions: โ†ณ entityframework-extensions.nโ€ฆ ๐Ÿ‘‰ See real-world benchmarks: โ†ณ github.com/zzzprojects/Entitโ€ฆ ๐Ÿ‘‰ Get the source code of this video: โ†ณ github.com/anton-martyniuk/eโ€ฆ โ€”โ€” โ™ป๏ธ 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.
8
10
58
2,743
๐—ง๐—ต๐—ฒ ๐—–๐—ผ๐—บ๐—ฝ๐—น๐—ฒ๐˜๐—ฒ ๐—š๐˜‚๐—ถ๐—ฑ๐—ฒ ๐˜๐—ผ ๐—•๐˜‚๐—น๐—ธ ๐—ข๐—ฝ๐—ฒ๐—ฟ๐—ฎ๐˜๐—ถ๐—ผ๐—ป๐˜€ ๐˜„๐—ถ๐˜๐—ต ๐—˜๐—ป๐˜๐—ถ๐˜๐˜† ๐—™๐—ฟ๐—ฎ๐—บ๐—ฒ๐˜„๐—ผ๐—ฟ๐—ธ ๐—˜๐˜…๐˜๐—ฒ๐—ป๐˜€๐—ถ๐—ผ๐—ป๐˜€ This library was one of the best investments for me Do you know why SaveChanges method in DbContext is slow when you insert a large number of entities? In many databases, EF Core batches multiple inserts into a single command. But the database still executes these inserts one by one. For SQL Server - EF Core uses a MERGE statement to insert multiple rows at once. However, EF Core's approach is limited by the number of SQL parameters (2,100 per batch). Performance drops quickly when entities have many columns. In the video, I show a detailed guide on bulk write operations with ๐—˜๐—ป๐˜๐—ถ๐˜๐˜† ๐—™๐—ฟ๐—ฎ๐—บ๐—ฒ๐˜„๐—ผ๐—ฟ๐—ธ ๐—˜๐˜…๐˜๐—ฒ๐—ป๐˜€๐—ถ๐—ผ๐—ป๐˜€ library. I explore in depth the following methods: - BulkInsert - BulkInsertOptimized - BulkUpdate - BulkDelete - BulkMerge - BulkSynchronize - BulkSaveChanges And as well as their various options. This NuGet package is easy to add to an existing project: - Add the package - One line of code to perform blazing-fast bulk write operations EF Core Extensions: ๐Ÿ“Œ Works with SQL Server, Postgres, MySQL, Oracle, MariaDB, SQLite. ๐Ÿ“Œ Supports EF Core 2 โ†’ 9, all inheritance types, and complex entities. This is a paid library, but the investment in it - pays off quickly through improved performance, reduced development time, and simplified maintenance. You can try EF Core Extensions for free with the monthly trial. ๐Ÿ‘‰ Get started with EF Core Extensions: โ†ณ entityframework-extensions.nโ€ฆ ๐Ÿ‘‰ See real-world benchmarks: github.com/zzzprojects/Entitโ€ฆ ๐Ÿ‘‰ Get the source code: github.com/anton-martyniuk/eโ€ฆ โ€”โ€” โ™ป๏ธ Repost to help others learn about EF Core Extensions library โž• Follow me ( @AntonMartyniuk ) to improve your .NET and Architecture Skills Many thanks to ZZZ Projects for sponsoring this post.
4
12
63
1,623
๐—ช๐—ต๐˜† ๐—˜๐˜ƒ๐—ฒ๐—ฟ๐˜† ๐—˜๐—™ ๐—–๐—ผ๐—ฟ๐—ฒ ๐——๐—ฒ๐˜ƒ๐—ฒ๐—น๐—ผ๐—ฝ๐—ฒ๐—ฟ ๐—ก๐—ฒ๐—ฒ๐—ฑ๐˜€ ๐˜๐—ผ ๐—ง๐—ฟ๐˜† ๐—˜๐—ป๐˜๐—ถ๐˜๐˜† ๐—™๐—ฟ๐—ฎ๐—บ๐—ฒ๐˜„๐—ผ๐—ฟ๐—ธ ๐—˜๐˜…๐˜๐—ฒ๐—ป๐˜€๐—ถ๐—ผ๐—ป๐˜€ SaveChanges method in DbContext slows you down ๐Ÿ‘‡ ๐Ÿ‘‰ EF Core batches inserts depending on the provider, but itโ€™s still not a true bulk insert โ€” and entity tracking adds extra memory overhead. This becomes even more noticeable as the number of rows grows into the thousands or millions. In the video, I show how I solve this problem with ๐—˜๐—ป๐˜๐—ถ๐˜๐˜† ๐—™๐—ฟ๐—ฎ๐—บ๐—ฒ๐˜„๐—ผ๐—ฟ๐—ธ ๐—˜๐˜…๐˜๐—ฒ๐—ป๐˜€๐—ถ๐—ผ๐—ป๐˜€ library. This NuGet package is easy to add to an existing project: - Add the package - One line of code to perform blazing-fast bulk inserts - No extra configuration required In my tests with SQL Server: โ€ข SaveChanges took ~2,000 ms โ€ข BulkInsert took ~200 ms โ€ข BulkInsertOptimized took only โšก130 ms EF Core Extensions supports the following bulk write operations: 1๏ธโƒฃ BulkUpdate โ†’ update 1000s of records at once 2๏ธโƒฃ BulkDelete โ†’ delete large datasets fast 3๏ธโƒฃ BulkMerge โ†’ upsert (insert or update) in one step 4๏ธโƒฃ BulkSynchronize โ†’ keep your data in sync automatically 5๏ธโƒฃ FutureAction โ†’ queue multiple bulk operations and run them later Bulk operations also work with child entities. EF Core Extensions: ๐Ÿ“Œ Works with SQL Server, Postgres, MySQL, Oracle, MariaDB, SQLite. ๐Ÿ“Œ Supports EF Core 2 โ†’ 9, all inheritance types, and complex entities. If you're working with large datasets, this library is a game changer. You'll insert, update, and delete thousands of rows 10-15x times faster than using regular SaveChanges. And the best part? You can try it for free with the monthly trial. ๐Ÿ‘‰ Get started with EF Core Extensions: โ†ณ entityframework-extensions.nโ€ฆ ๐Ÿ‘‰ See real-world benchmarks: github.com/zzzprojects/Entitโ€ฆ ๐Ÿ‘‰ Get the source code: github.com/anton-martyniuk/eโ€ฆ โ€”โ€” โ™ป๏ธ Repost to help others learn about EF Core Extensions library โž• Follow me ( @AntonMartyniuk ) to improve your .NET Skills Many thanks to ZZZ Projects for sponsoring this post.
5
12
65
4,606
ZZZ Projects retweeted
SQL Fiddle has launched a new version for 2024: sqlfiddle.com/ ๐Ÿš€ Now featuring enhanced stability, a sleek design, and an AI Chat feature! Give it a try. More changes coming soon. #AI #SQLFiddle #SQL #SQLServer #MySQL #PostgreSQL
1
1
2
145
Wait, what? #Dapper and #EntityFramework #EFCore together? That's right. In just over 1 hour we are excited to welcome @Nick_Craver and @marcgravell to talk all things Dapper and answers your questions live. Check out the live stream on YouTube here: youtu.be/txiQar6PqvA
5
24
2
92