DataArc
EntityFrameworkCore

Structured Entity Framework Core command and query pipelines for coordinated data operations across multiple persistence boundaries.

View on GitHub
DataArc.EntityFrameworkCore

var command = await _commandFactory.CreateCommandAsync();
await command
    .UseDbExecutionContext<IApplicationDbContext>()
    .AddBulk(foreignEntityExampleList, batchSize)
    .ExecuteAsync();
EF

Execution context routing

Initialize DataArc once at the application root, then configure EF Core execution contexts through module-safe DataArc configuration.

  • AddDataArcCore handles root setup and license validation.
  • ConfigureDataArc adds package and module configuration.
  • UseDbExecutionContext routes each command or query group explicitly.

Bulk write benchmark

BenchmarkDotNet

DataArc.EntityFrameworkCore bulk insert benchmark using the command pipeline with a fixed batch size of 250,000 records. Allocation scaled linearly across the tested row counts.

250,000 rows 715 ms 44.36 MB allocated
500,000 rows 1.745 s 88.6 MB allocated
1,000,000 rows 3.383 s 177.26 MB allocated
Rows inserted Batch size Mean Allocated
250,000 250,000 715 ms 44.36 MB
500,000 250,000 1.745 s 88.6 MB
1,000,000 250,000 3.383 s 177.26 MB

InvocationCount=1, IterationCount=10, UnrollFactor=1.

DataArc Orchestration Framework

Keep complex .NET application flows structured and coordinated without scattering business logic across disconnected execution paths.

View on GitHub
DataArc.Orchestrator / DataArc.Observer
internal class RepatriationOrchestrator
    : Orchestrator<OrchestratorInput, OrchestratorOutput>
{
    public RepatriationOrchestrator(ICommandFactory commandFactory, IQueryFactory queryFactory)
    {
        _commandFactory = commandFactory;
        _queryFactory = queryFactory;
    }

    public override async Task<OrchestratorOutput> ExecuteAsync(
        OrchestratorInput input,
        OrchestratorOutput output)
    {
        try
        {
            var query = await _queryFactory.CreateQueryAsync();
            var repatriationData = await query
                .UseDbExecutionContext<IApplicationDbContext>()
                .ReadWhereAsync<PrimaryEntityExample>(x => x.Id == input.Id);

            var command = await _commandFactory.CreateCommandAsync();
            var commandResult = await command
                .UseDbExecutionContext<IApplicationDbContext>()
                .AddBulk(repatriationData, input.BatchSize)
                .ExecuteAsync();

            if (!commandResult.Success)
                _logger.LogError(commandResult.Exception.Message);

            output.Result = commandResult;
            return output;
        }
        catch
        {
            throw;
        }
    }
}
OF

CQRS workflow boundary

Build CQRS-style application workflows through explicit input and output contracts.

  • Keep use cases structured behind a dedicated orchestration boundary.
  • Route reads through query execution contexts.
  • Route writes through command execution contexts.
  • Return predictable workflow results from one application flow.