DataArc
EntityFrameworkCore
Structured Entity Framework Core command and query pipelines for coordinated data operations across multiple persistence boundaries.
View on GitHub
var command = await _commandFactory.CreateCommandAsync();
await command
.UseDbExecutionContext<IApplicationDbContext>()
.AddBulk(foreignEntityExampleList, batchSize)
.ExecuteAsync();
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
BenchmarkDotNetDataArc.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.
| 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 GitHubinternal 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;
}
}
}
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.