Z.EntityFramework.Extensions 3.16.4

Entity Framework: Bulk Insert, BulkSaveChanges, Bulk Update, Bulk Delete, Bulk Merge, and Bulk Synchronize.

Support: SQL Server, SQL Azure, SQL Compact, Oracle, MySQL, SQLite, and PostgreSQL.

This library is NOT FREE. Trial period always stops at the end of the month.

There is a newer version of this package available.
See the version list below for details.
Install-Package Z.EntityFramework.Extensions -Version 3.16.4
dotnet add package Z.EntityFramework.Extensions --version 3.16.4
paket add Z.EntityFramework.Extensions --version 3.16.4
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
// Fiddle: https://dotnetfiddle.net/awlJdf
// @nuget: EntityFramework
// @nuget: Z.EntityFramework.Extensions
// Website: https://entityframework-extensions.net/

using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Data.Entity;
public class Program
{
	public static List<BenchmarkResult> BenchmarkResults = new List<BenchmarkResult>();
	
	public static void Main()
	{
		JustInTime_Compile();
		
		// Generate X entities
		var customers = GenerateCustomers(1000);
		var inactiveCustomers = customers.Where(x => !x.IsActive).ToList();
		
		var clockInsert = new Stopwatch();
		var clockUpdate = new Stopwatch();
		var clockDelete = new Stopwatch();
		
		using (var context = new EntityContext())
		{
			// BulkInsert
			{
				clockInsert.Start();
				context.BulkInsert(customers);
				clockInsert.Stop();
				
				BenchmarkResults.Add(new BenchmarkResult() { Action = "BulkInsert", Entities = customers.Count, Performance = clockInsert.ElapsedMilliseconds + " ms" });
			}
			
			// BulkUpdate
			{
				inactiveCustomers.ForEach(x => x.Name = "zzz;" + x.Name);
				clockUpdate.Start();
				context.BulkUpdate(inactiveCustomers);
				clockUpdate.Stop();
				
				BenchmarkResults.Add(new BenchmarkResult() { Action = "BulkUpdate", Entities = inactiveCustomers.Count, Performance = clockUpdate.ElapsedMilliseconds + " ms" });
			}
			
			// BulkDelete
			{
				clockDelete.Start();
				context.BulkDelete(inactiveCustomers);
				clockDelete.Stop();
				
				BenchmarkResults.Add(new BenchmarkResult() { Action = "BulkDelete", Entities = inactiveCustomers.Count, Performance = clockDelete.ElapsedMilliseconds + " ms" });
			}
		}
		
		FiddleHelper.WriteTable("EFE - Easy to use, easy to customize!", BenchmarkResults);
	}
		 
	public static void JustInTime_Compile()
	{
		var customers = GenerateCustomers(10);
		
		using (var context = new EntityContext())
		{
			context.BulkInsert(customers);
			context.BulkDelete(customers);
		}
	}
	
	public static List<Customer> GenerateCustomers(int count)
	{
		var list = new List<Customer>();
		
		for(int i = 0; i < count; i++)
		{
			list.Add(new Customer() { Name = "Customer_" + i, Description = "Description_" +  i, IsActive = i % 2 == 0 });
		}

		return list;
	}

	public class EntityContext : DbContext
	{
		public EntityContext() : base(FiddleHelper.GetConnectionStringSqlServer())
		{

		}
		
		public DbSet<Customer> Customers { get; set; }
	}

	public class Customer
	{
		public int CustomerID { get; set; }
		public string Name { get; set; }
		public string Description { get; set; }
		public Boolean IsActive { get; set; }
	}
	
	public class BenchmarkResult
	{
		public string Action { get; set; }
		public int Entities { get; set; }
		public string Performance { get; set; }
	}
}
// Fiddle: https://dotnetfiddle.net/awlJdf
// @nuget: EntityFramework
// @nuget: Z.EntityFramework.Extensions
// Website: https://entityframework-extensions.net/

using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Data.Entity;
public class Program
{
	public static List<BenchmarkResult> BenchmarkResults = new List<BenchmarkResult>();
	
	public static void Main()
	{
		JustInTime_Compile();
		
		// Generate X entities
		var customers = GenerateCustomers(1000);
		var inactiveCustomers = customers.Where(x => !x.IsActive).ToList();
		
		var clockInsert = new Stopwatch();
		var clockUpdate = new Stopwatch();
		var clockDelete = new Stopwatch();
		
		using (var context = new EntityContext())
		{
			// BulkInsert
			{
				clockInsert.Start();
				context.BulkInsert(customers);
				clockInsert.Stop();
				
				BenchmarkResults.Add(new BenchmarkResult() { Action = "BulkInsert", Entities = customers.Count, Performance = clockInsert.ElapsedMilliseconds + " ms" });
			}
			
			// BulkUpdate
			{
				inactiveCustomers.ForEach(x => x.Name = "zzz;" + x.Name);
				clockUpdate.Start();
				context.BulkUpdate(inactiveCustomers);
				clockUpdate.Stop();
				
				BenchmarkResults.Add(new BenchmarkResult() { Action = "BulkUpdate", Entities = inactiveCustomers.Count, Performance = clockUpdate.ElapsedMilliseconds + " ms" });
			}
			
			// BulkDelete
			{
				clockDelete.Start();
				context.BulkDelete(inactiveCustomers);
				clockDelete.Stop();
				
				BenchmarkResults.Add(new BenchmarkResult() { Action = "BulkDelete", Entities = inactiveCustomers.Count, Performance = clockDelete.ElapsedMilliseconds + " ms" });
			}
		}
		
		FiddleHelper.WriteTable("EFE - Easy to use, easy to customize!", BenchmarkResults);
	}
		 
	public static void JustInTime_Compile()
	{
		var customers = GenerateCustomers(10);
		
		using (var context = new EntityContext())
		{
			context.BulkInsert(customers);
			context.BulkDelete(customers);
		}
	}
	
	public static List<Customer> GenerateCustomers(int count)
	{
		var list = new List<Customer>();
		
		for(int i = 0; i < count; i++)
		{
			list.Add(new Customer() { Name = "Customer_" + i, Description = "Description_" +  i, IsActive = i % 2 == 0 });
		}

		return list;
	}

	public class EntityContext : DbContext
	{
		public EntityContext() : base(FiddleHelper.GetConnectionStringSqlServer())
		{

		}
		
		public DbSet<Customer> Customers { get; set; }
	}

	public class Customer
	{
		public int CustomerID { get; set; }
		public string Name { get; set; }
		public string Description { get; set; }
		public Boolean IsActive { get; set; }
	}
	
	public class BenchmarkResult
	{
		public string Action { get; set; }
		public int Entities { get; set; }
		public string Performance { get; set; }
	}
}

Version History

Version Downloads Last updated
3.16.43 10 3/23/2019
3.16.42 361 3/19/2019
3.16.41 55 3/19/2019
3.16.40 378 3/15/2019
3.16.39 29 3/15/2019
3.16.38 102 3/15/2019
3.16.37 422 3/13/2019
3.16.36 48 3/12/2019
3.16.35 192 3/12/2019
3.16.34 96 3/12/2019
3.16.33 434 3/8/2019
3.16.32 464 3/8/2019
3.16.31 988 3/4/2019
3.16.30 1,031 3/1/2019
3.16.29 972 2/28/2019
3.16.28 250 2/27/2019
3.16.27 614 2/25/2019
3.16.26 202 2/24/2019
3.16.25 481 2/21/2019
3.16.24 2,363 2/12/2019
3.16.23 7,722 1/30/2019
3.16.22 4,369 1/18/2019
3.16.21 883 1/15/2019
3.16.20 306 1/14/2019
3.16.19 1,826 1/8/2019
3.16.18 2,180 12/30/2018
3.16.17 3,021 12/20/2018
3.16.16 1,192 12/15/2018
3.16.15 2,483 12/7/2018
3.16.14 4,540 11/29/2018
3.16.13 638 11/28/2018
3.16.12 1,994 11/20/2018
3.16.11 4,823 11/9/2018
3.16.10 933 11/6/2018
3.16.9 3,626 10/30/2018
3.16.8 379 10/28/2018
3.16.7 1,722 10/23/2018
3.16.6 132 10/23/2018
3.16.5 6,490 10/16/2018
3.16.4 331 10/15/2018
3.16.3 2,894 10/8/2018
3.16.2 16,652 9/29/2018
3.16.1 533 9/27/2018
3.16.0 3,509 9/13/2018
3.15.22 1,430 9/12/2018
3.15.21 180 9/11/2018
3.15.20 3,202 9/1/2018
3.15.19 880 8/30/2018
3.15.17 9,900 8/2/2018
3.15.16 215 8/2/2018
3.15.15 3,119 7/31/2018
3.15.14 548 7/31/2018
3.15.12 1,715 7/25/2018
3.15.11 216 7/25/2018
3.15.10 173 7/25/2018
3.15.9 1,210 7/20/2018
3.15.8 597 7/19/2018
3.15.7 146 7/19/2018
3.15.6 1,412 7/16/2018
3.15.5 2,857 7/8/2018
3.15.4 9,208 6/29/2018
3.15.3 3,706 6/21/2018
3.15.2 582 6/20/2018
3.15.1 365 6/19/2018
3.15.0 4,000 6/12/2018
3.14.33 4,388 6/5/2018
3.14.32 3,788 6/1/2018
3.14.31 816 5/31/2018
3.14.30 281 5/30/2018
3.14.29 1,414 5/27/2018
3.14.28 5,886 5/25/2018
3.14.27 1,291 5/22/2018
3.14.26 3,732 5/9/2018
3.14.25 5,716 5/1/2018
3.14.24 8,069 4/23/2018
3.14.23 4,539 4/17/2018
3.14.22 652 4/16/2018
3.14.21 525 4/13/2018
3.14.20 495 4/11/2018
3.14.19 416 4/11/2018
3.14.18 3,408 4/7/2018
3.14.17 4,199 3/30/2018
3.14.16 295 3/29/2018
3.14.14 1,431 3/27/2018
3.14.13 1,151 3/25/2018
3.14.12 5,463 3/5/2018
3.14.11 2,475 2/28/2018
3.14.10 1,710 2/27/2018
3.14.9 1,466 2/22/2018
3.14.8 12,317 2/14/2018
3.14.7 22,723 1/31/2018
3.14.5 24,221 1/3/2018
3.14.4 3,072 12/28/2017
3.14.3 2,867 12/19/2017
3.14.2 340 12/19/2017
3.14.1 836 12/14/2017
3.14.0 7,942 11/30/2017
3.13.16 876 11/27/2017
3.13.14 235 11/27/2017
3.13.13 3,890 11/20/2017
3.13.12 5,440 11/9/2017
3.13.11 660 11/7/2017
3.13.10 1,451 11/2/2017
3.13.9 4,216 10/30/2017
3.13.8 709 10/26/2017
3.13.7 275 10/26/2017
3.13.6 1,953 10/22/2017
3.13.5 3,806 10/16/2017
3.13.4 487 10/13/2017
3.13.3 5,845 10/4/2017
3.13.2 8,810 9/30/2017
3.13.1 2,370 9/27/2017
3.13.0 4,038 9/25/2017
3.12.27 1,617 9/18/2017
3.12.26 2,023 9/12/2017
3.12.25 217 9/12/2017
3.12.24 2,148 9/6/2017
3.12.23 17,768 8/31/2017
3.12.22 771 8/31/2017
3.12.21 260 8/30/2017
3.12.20 3,944 8/28/2017
3.12.19 5,484 8/15/2017
3.12.18 1,156 8/11/2017
3.12.17 1,456 8/6/2017
3.12.16 570 8/3/2017
3.12.15 38,327 7/25/2017
3.12.14 4,551 7/12/2017
3.12.13 3,296 7/4/2017
3.12.12 249 7/4/2017
3.12.11 720 7/3/2017
3.12.10 1,197 7/2/2017
3.12.9 6,808 6/29/2017
3.11.20 2,209 4/30/2017
Show less