C# and .NET Runtime Guide
For AI-assisted development, use the generated Assist contracts with the TeaQL Agent Kit Harness Engineering workflow.
The .NET target generates C# entities, Request builders, Q and expression APIs, relation metadata,
native aggregates and audited graph persistence. It uses ADO.NET providers while keeping query
semantics aligned with generated Java Requests.
Start here
Use this sequence for a .NET service:
- .NET Quick Start — prepare the solution, generate the domain project, initialize context, query and save.
- .NET First Verification — prove real ADO.NET persistence, governance, optimistic locking, audit and SQL semantics.
- .NET Customization — integrate dependency injection, policy, behavior, dynamic input validation, audit sinks and providers.
- .NET Business Scenarios — implement relations, aggregates, stable pagination and provider-specific execution.
NuGet coordinates and the public generator target are intentionally deferred until release rather than documented as guessed package names.
Query and mutation boundary
Generated execution receives only UserContext; provider and data-service dependencies are resolved
from that context.
var orders = await Q.CustomerOrders()
.Comment("Find orders awaiting review")
.Purpose("Prepare the authorized review queue")
.ExecuteForListAsync(context);
There is no (context, service) compatibility overload. Purpose is the transition to the executable
Request state, and a non-empty comment must already exist. Saving requires an audit reason:
order = await order.AuditAs("Approve reviewed order").SaveAsync(context);
Read the freshly generated Request and Entity source before using a method; casing and async suffixes are part of the generated contract.
Verified providers
| Database | Provider observed in acceptance | Feature status |
|---|---|---|
| PostgreSQL | Npgsql 10.0.3 | PASS |
| MySQL | MySqlConnector 2.6.1 | PASS |
| SQLite | Microsoft.Data.Sqlite 8.0.29 | PASS |
| SQL Server | Microsoft SQL Server provider | PASS |
SQL Server completed the same full Order Search Feature as the core three databases; it is not
classified as persistence-only. Builds should use -p:UseSharedCompilation=false in environments
where the Roslyn shared compiler can remain stuck.