Reference

Entity Framework Integration

Reuse your EF Core DbContext connection/transaction when calling generated procedures.

Enable in config

Enable EF support before building:

{
  "EntityFramework": { "Enabled": true }
}

Register once

builder.Services.AddDbContext<AppDbContext>(options =>
    options.UseSqlServer(connectionString));

builder.Services.AddXtraqDbContext();          // generated services
builder.Services.UseXtraqProcedures<AppDbContext>(); // reuse ambient EF connection/transaction
  • The adapter joins the current EF transaction when present; otherwise it opens its own connection.
  • Command timeout follows EF unless you set XtraqDbContextOptions.CommandTimeout.

Mapping rows to entities (optional)

var adapter = scope.ServiceProvider.GetRequiredService<ProcedureResultEntityAdapter<AppDbContext>>();
var banners = adapter.AttachEntities<Banner, BannerProcedure.ResultRow>(result.Result);
  • Use AttachEntities for tracked entities, ProjectKeyless for read-only models.

Need more?

  • Transaction behaviour and hook points are covered in generated XML docs; extend via partials if you need diagnostics.