DataArc.EntityFrameworkCore

High-performance EF Core execution without replacing EF Core.

NuGet Website .NET

DataArc.EntityFrameworkCore extends ordinary Entity Framework Core with bulk and parallel persistence execution.

It does not replace DbContext, IDbContextFactory<TContext>, LINQ, EF Core change tracking, or normal application architecture.

EF Core
    owns DbContext and data access

DataArc.EntityFrameworkCore
    adds bulk and parallel execution

.NET
    coordinates independent DbContexts

Package model

DataArc 2.0 separates the free EF Core execution package from the commercial SQL Server package.

DataArc.EntityFrameworkCore

The free package contains the general EF Core execution capabilities:

  • direct bulk insertion;
  • caller-owned transactional bulk execution;
  • fluent AsParallel() persistence execution;
  • Add, AddRange, Update, Remove, and AddBulk;
  • SaveChangesParallelAsync().

No DataArc runtime license is required for this package.

<PackageReference Include="DataArc.EntityFrameworkCore" Version="2.0.0" />

DataArc.EntityFrameworkCore.SqlServer

The SQL Server package adds commercial SQL Server-specific capabilities, including:

  • DataArc-owned transaction execution;
  • AsParallelTransaction();
  • CommitTransactionParallelAsync();
  • multi-DbContext coordination;
  • relational database-definition tooling;
  • multi-context DDL generation.
<PackageReference Include="DataArc.EntityFrameworkCore.SqlServer" Version="2.0.0" />

The SQL Server package carries DataArc.EntityFrameworkCore as a dependency.

Core execution model

Normal reads remain normal EF Core:

await using var dbContext =
    await dbContextFactory.CreateDbContextAsync();

var employees = await dbContext.Employee!
    .AsNoTracking()
    .Where(employee => employee.Rating > 4.5)
    .ToListAsync();

Use DataArc where execution benefits from bulk or parallel work:

await dbContext
    .AsParallel()
    .AddBulk(employers, batchSize)
    .AddBulk(employees, batchSize)
    .SaveChangesParallelAsync();

For commercial SQL Server transaction execution:

await dbContext
    .AsParallelTransaction()
    .AddBulk(employers, batchSize)
    .AddBulk(employees, batchSize)
    .CommitTransactionParallelAsync();

Demonstration repositories

The DataArc.EntityFrameworkCore demo uses four independent SQL Server databases and demonstrates normal EF Core reads with DataArc bulk and parallel writes.

The DataArc Orchestration Framework demo demonstrates the multi-context DDL Builder with HR, Finance, IT, and Operations DbContext models composed into one physical relational database.

Documentation

Public resources