ApricotFramework.DataOps.AspNetCore 0.1.0

Prefix Reserved
dotnet add package ApricotFramework.DataOps.AspNetCore --version 0.1.0
                    
NuGet\Install-Package ApricotFramework.DataOps.AspNetCore -Version 0.1.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="ApricotFramework.DataOps.AspNetCore" Version="0.1.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="ApricotFramework.DataOps.AspNetCore" Version="0.1.0" />
                    
Directory.Packages.props
<PackageReference Include="ApricotFramework.DataOps.AspNetCore" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add ApricotFramework.DataOps.AspNetCore --version 0.1.0
                    
#r "nuget: ApricotFramework.DataOps.AspNetCore, 0.1.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package ApricotFramework.DataOps.AspNetCore@0.1.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=ApricotFramework.DataOps.AspNetCore&version=0.1.0
                    
Install as a Cake Addin
#tool nuget:?package=ApricotFramework.DataOps.AspNetCore&version=0.1.0
                    
Install as a Cake Tool

ApricotFramework.DataOps

NuGet NuGet NuGet CI License

SQL lives in XML files with a schema, addressed by group and name, and executed with Dapper — so a query can be reviewed, reused across services, and written per database engine without the calling code knowing which engine it reached.

ApricotFramework.DataOps.Abstractions is the zero-dependency contract.

Install

dotnet add package ApricotFramework.DataOps.AspNetCore
dotnet add package ApricotFramework.DataOps.Abstractions   # for a library that only calls IDataOperations

Usage


<DataOperations>
  <DataConfiguration Compatibility="Sqlite" Timeout="PT30S" />
  <OperationGroup Name="Authors">
    <SqlOperation Name="All">
      <TextCommand ExpectedResult="Table">
        SELECT id, full_name, born_in FROM authors ORDER BY {if:byName{ full_name } else { id }}
      </TextCommand>
    </SqlOperation>
  </OperationGroup>
</DataOperations>
builder.Services.AddDataOperations(builder.Configuration);
builder.Services.AddDataSourceConnection(SqlProvider.Sqlite, cs => new SqliteConnection(cs));
builder.Services.AddOperationsDefinitionSource<AuthorOperationsSource>();
// One operation: connect, address it, run it.
var authors = await dataOps.Connect().Query("Authors", "All")
    .WithBinding("byName", true)
    .ExecuteAsync<Author>();

// Several operations on one connection, in one transaction.
await using var scope = await dataOps.BeginAsync(AutoTransaction.Serializable);
await scope.Router.NonQuery("Authors", "Create").ExecuteAsync(author);
await scope.Router.NonQuery("Audit", "Append").ExecuteAsync(entry);
await scope.CommitAsync();      // disposing without this rolls back

Which engine an operation is written for is declared, not inferred: an operation compatible with MySql PostgreSql is invisible to a SQLite connection, so the same key can carry a different statement per engine.

Note. Column matching ignores underscores by default, so full_name fills FullName. This is Dapper's process-wide setting and it applies to settable properties only — a positional record will not materialize from underscored columns. Turn it off with DataOperations:MatchNamesWithUnderscores.

Full documentation at projectapricot.dev.

Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.1.0 162 8/16/2026