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.22 62 1/18/2019
3.16.21 401 1/15/2019
3.16.20 166 1/14/2019
3.16.19 1,131 1/8/2019
3.16.18 1,388 12/30/2018
3.16.17 1,391 12/20/2018
3.16.16 872 12/15/2018
3.16.15 1,594 12/7/2018
3.16.14 3,314 11/29/2018
3.16.13 415 11/28/2018
3.16.12 1,517 11/20/2018
3.16.11 4,142 11/9/2018
3.16.10 862 11/6/2018
3.16.9 2,903 10/30/2018
3.16.8 314 10/28/2018
3.16.7 1,016 10/23/2018
3.16.6 94 10/23/2018
3.16.5 3,874 10/16/2018
3.16.4 208 10/15/2018
3.16.3 2,266 10/8/2018
3.16.2 11,972 9/29/2018
3.16.1 472 9/27/2018
3.16.0 3,143 9/13/2018
3.15.22 722 9/12/2018
3.15.21 137 9/11/2018
3.15.20 2,716 9/1/2018
3.15.19 821 8/30/2018
3.15.17 8,358 8/2/2018
3.15.16 176 8/2/2018
3.15.15 2,779 7/31/2018
3.15.14 513 7/31/2018
3.15.12 1,344 7/25/2018
3.15.11 179 7/25/2018
3.15.10 136 7/25/2018
3.15.9 1,150 7/20/2018
3.15.8 483 7/19/2018
3.15.7 108 7/19/2018
3.15.6 1,230 7/16/2018
3.15.5 2,413 7/8/2018
3.15.4 8,118 6/29/2018
3.15.3 2,820 6/21/2018
3.15.2 536 6/20/2018
3.15.1 317 6/19/2018
3.15.0 3,330 6/12/2018
3.14.33 4,263 6/5/2018
3.14.32 3,222 6/1/2018
3.14.31 763 5/31/2018
3.14.30 236 5/30/2018
3.14.29 1,251 5/27/2018
3.14.28 3,682 5/25/2018
3.14.27 1,211 5/22/2018
3.14.26 3,274 5/9/2018
3.14.25 5,471 5/1/2018
3.14.24 7,115 4/23/2018
3.14.23 3,797 4/17/2018
3.14.22 605 4/16/2018
3.14.21 476 4/13/2018
3.14.20 453 4/11/2018
3.14.19 376 4/11/2018
3.14.18 2,867 4/7/2018
3.14.17 3,810 3/30/2018
3.14.16 251 3/29/2018
3.14.14 1,332 3/27/2018
3.14.13 1,097 3/25/2018
3.14.12 4,971 3/5/2018
3.14.11 2,111 2/28/2018
3.14.10 1,669 2/27/2018
3.14.9 1,280 2/22/2018
3.14.8 10,394 2/14/2018
3.14.7 21,342 1/31/2018
3.14.5 21,715 1/3/2018
3.14.4 2,907 12/28/2017
3.14.3 2,814 12/19/2017
3.14.2 296 12/19/2017
3.14.1 783 12/14/2017
3.14.0 7,308 11/30/2017
3.13.16 800 11/27/2017
3.13.14 195 11/27/2017
3.13.13 3,031 11/20/2017
3.13.12 4,766 11/9/2017
3.13.11 616 11/7/2017
3.13.10 1,398 11/2/2017
3.13.9 3,730 10/30/2017
3.13.8 668 10/26/2017
3.13.7 230 10/26/2017
3.13.6 1,791 10/22/2017
3.13.5 3,451 10/16/2017
3.13.4 447 10/13/2017
3.13.3 5,329 10/4/2017
3.13.2 7,639 9/30/2017
3.13.1 1,659 9/27/2017
3.13.0 3,349 9/25/2017
3.12.27 1,433 9/18/2017
3.12.26 1,971 9/12/2017
3.12.25 176 9/12/2017
3.12.24 1,672 9/6/2017
3.12.23 16,673 8/31/2017
3.12.22 732 8/31/2017
3.12.21 221 8/30/2017
3.12.20 3,481 8/28/2017
3.12.19 5,394 8/15/2017
3.12.18 1,066 8/11/2017
3.12.17 1,337 8/6/2017
3.12.16 514 8/3/2017
3.12.15 35,732 7/25/2017
3.12.14 4,352 7/12/2017
3.12.13 2,499 7/4/2017
3.12.12 205 7/4/2017
3.12.11 675 7/3/2017
3.12.10 1,139 7/2/2017
3.12.9 6,309 6/29/2017
3.11.20 2,113 4/30/2017
Show less