Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Benchmark/CaeriusNet.Benchmark.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<ItemGroup>
<PackageReference Include="BenchmarkDotNet" Version="0.15.8"/>
<PackageReference Include="Bogus" Version="35.6.5"/>
<PackageReference Include="Microsoft.Data.SqlClient" Version="7.0.1"/>
<PackageReference Include="Microsoft.Data.SqlClient" Version="7.0.2"/>
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Aspire.Hosting.AppHost" Version="13.3.5"/>
<PackageReference Include="Aspire.Hosting.Redis" Version="13.3.5"/>
<PackageReference Include="Aspire.Hosting.SqlServer" Version="13.3.5"/>
<PackageReference Include="Aspire.StackExchange.Redis" Version="13.3.5"/>
<PackageReference Include="Aspire.Hosting.AppHost" Version="13.4.6"/>
<PackageReference Include="Aspire.Hosting.Redis" Version="13.4.6"/>
<PackageReference Include="Aspire.Hosting.SqlServer" Version="13.4.6"/>
<PackageReference Include="Aspire.StackExchange.Redis" Version="13.4.6"/>
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,8 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Aspire.StackExchange.Redis" Version="13.3.5" />
<PackageReference Include="Microsoft.Extensions.Hosting" Version="10.0.9"/>
<!-- Ensure the app process loads Microsoft.Data.SqlClient (align with library) -->
<PackageReference Include="Microsoft.Data.SqlClient" Version="7.0.1"/>
<PackageReference Include="Microsoft.Data.SqlClient" Version="7.0.2"/>
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@

<PackageReference Include="Microsoft.Extensions.Http.Resilience" Version="10.7.0"/>
<PackageReference Include="Microsoft.Extensions.ServiceDiscovery" Version="10.7.0"/>
<PackageReference Include="OpenTelemetry.Exporter.OpenTelemetryProtocol" Version="1.15.3"/>
<PackageReference Include="OpenTelemetry.Exporter.OpenTelemetryProtocol" Version="1.16.0"/>
<PackageReference Include="OpenTelemetry.Extensions.Hosting" Version="1.16.0"/>
<PackageReference Include="OpenTelemetry.Instrumentation.AspNetCore" Version="1.15.2"/>
<PackageReference Include="OpenTelemetry.Instrumentation.Http" Version="1.15.1"/>
<PackageReference Include="OpenTelemetry.Instrumentation.AspNetCore" Version="1.16.0"/>
<PackageReference Include="OpenTelemetry.Instrumentation.Http" Version="1.16.0"/>
<PackageReference Include="OpenTelemetry.Instrumentation.Runtime" Version="1.15.1"/>
</ItemGroup>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Aspire.StackExchange.Redis" Version="13.3.5" />
<PackageReference Include="Microsoft.Extensions.Logging.Console" Version="10.0.9"/>
</ItemGroup>

Expand Down
9 changes: 4 additions & 5 deletions Src/CaeriusNet.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
</PropertyGroup>

<PropertyGroup>
<Version>11.1.0</Version>
<Version>11.0.3</Version>
<Title>CaeriusNet</Title>
<Authors>AriusII &amp; CaeriusNet</Authors>
<Description>High-performance micro-ORM for C# 14 / .NET 10 and SQL Server. Execute Stored Procedures, map DTOs at compile-time ([GenerateDto]), pass Table-Valued Parameters ([GenerateTvp]), cache results, and verify SQL contracts at build time - all in a single package.</Description>
Expand Down Expand Up @@ -102,10 +102,9 @@

<ItemGroup>
<!-- Microsoft Data Access -->
<PackageReference Include="Aspire.Microsoft.Data.SqlClient" Version="13.3.5"/>
<PackageReference Include="Aspire.StackExchange.Redis" Version="13.3.5" />
<PackageReference Include="Aspire.StackExchange.Redis.DistributedCaching" Version="13.3.5"/>
<PackageReference Include="Microsoft.Data.SqlClient" Version="7.0.1"/>
<PackageReference Include="Aspire.Microsoft.Data.SqlClient" Version="13.4.6"/>
<PackageReference Include="Aspire.StackExchange.Redis.DistributedCaching" Version="13.4.6"/>
<PackageReference Include="Microsoft.Data.SqlClient" Version="7.0.2"/>

<!-- Microsoft Extensions -->
<PackageReference Include="Microsoft.Extensions.Caching.Memory" Version="10.0.9"/>
Expand Down
9 changes: 6 additions & 3 deletions Src/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ passes Table-Valued Parameters, and caches results — all in a single package,
dotnet add package CaeriusNet
```

AutoContracts is included in `CaeriusNet`. Set the MSBuild properties when you want build-time SQL Server contract discovery; there is no additional install step.
AutoContracts is included in `CaeriusNet`. Set the MSBuild properties when you want build-time SQL Server contract
discovery; there is no additional install step.

## Prerequisites

Expand Down Expand Up @@ -114,7 +115,8 @@ int rows = await dbContext.ExecuteNonQueryAsync(sp, ct);

## AutoContracts

AutoContracts validates stored procedure contracts from SQL Server metadata during normal builds. Add `CaeriusNet` to the project that owns your data-access code, then use MSBuild properties to pull or verify the manifest.
AutoContracts validates stored procedure contracts from SQL Server metadata during normal builds. Add `CaeriusNet` to
the project that owns your data-access code, then use MSBuild properties to pull or verify the manifest.

```xml
<PropertyGroup>
Expand All @@ -127,7 +129,8 @@ AutoContracts validates stored procedure contracts from SQL Server metadata duri
dotnet build
```

`Pull` creates or refreshes `caerius.contracts.json`. Commit that file with your code. In CI, switch to `Verify` so the build fails if SQL Server metadata drifts from the committed manifest.
`Pull` creates or refreshes `caerius.contracts.json`. Commit that file with your code. In CI, switch to `Verify` so the
build fails if SQL Server metadata drifts from the committed manifest.

## Caching

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

<ItemGroup>
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="5.3.0"/>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="18.6.0"/>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="18.7.0"/>
<PackageReference Include="xunit" Version="2.9.3"/>
<PackageReference Include="xunit.runner.visualstudio" Version="3.1.5">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="18.6.0"/>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="18.7.0"/>
<PackageReference Include="xunit" Version="2.9.3"/>
<PackageReference Include="xunit.runner.visualstudio" Version="3.1.5">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="18.6.0"/>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="18.7.0"/>
<PackageReference Include="xunit" Version="2.9.3"/>
<PackageReference Include="xunit.runner.visualstudio" Version="3.1.5">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="Microsoft.Data.SqlClient" Version="7.0.1"/>
<PackageReference Include="Microsoft.Data.SqlClient" Version="7.0.2"/>
<PackageReference Include="Testcontainers.MsSql" Version="4.12.0"/>
</ItemGroup>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ public async Task PackageContainsBuildTransitiveImports()
Assert.NotNull(archive.GetEntry("tools/net10.0/any/CaeriusNet.SqlServer.Contracts.deps.json"));
Assert.NotNull(archive.GetEntry("tools/net10.0/any/CaeriusNet.SqlServer.Contracts.runtimeconfig.json"));
Assert.NotNull(archive.GetEntry("tools/net10.0/any/Microsoft.Data.SqlClient.dll"));
Assert.NotNull(archive.GetEntry("tools/net10.0/any/Microsoft.Extensions.Configuration.EnvironmentVariables.dll"));
Assert.NotNull(
archive.GetEntry("tools/net10.0/any/Microsoft.Extensions.Configuration.EnvironmentVariables.dll"));
Assert.NotNull(archive.GetEntry("tools/net10.0/any/Microsoft.Extensions.Configuration.Json.dll"));

var nuspec = archive.Entries.Single(entry => entry.FullName.EndsWith(".nuspec", StringComparison.Ordinal));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="18.6.0"/>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="18.7.0"/>
<PackageReference Include="xunit" Version="2.9.3"/>
<PackageReference Include="xunit.runner.visualstudio" Version="3.1.5">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
Expand Down
4 changes: 2 additions & 2 deletions Tests/CaeriusNet.Tests/CaeriusNet.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="18.6.0"/>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="18.7.0"/>
<PackageReference Include="xunit" Version="2.9.3"/>
<PackageReference Include="xunit.runner.visualstudio" Version="3.1.5">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
Expand All @@ -28,7 +28,7 @@
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="Microsoft.Data.SqlClient" Version="7.0.1"/>
<PackageReference Include="Microsoft.Data.SqlClient" Version="7.0.2"/>
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Data.SqlClient" Version="7.0.1"/>
<PackageReference Include="Microsoft.Data.SqlClient" Version="7.0.2"/>
<PackageReference Include="Microsoft.Extensions.Configuration.EnvironmentVariables" Version="10.0.9"/>
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="10.0.9"/>
</ItemGroup>
Expand Down
29 changes: 16 additions & 13 deletions Tools/CaeriusNet.SqlServer.Contracts/README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
# AutoContracts tool

This project builds the internal AutoContracts SQL Server discovery tool that ships inside the main `CaeriusNet` NuGet package.
This project builds the internal AutoContracts SQL Server discovery tool that ships inside the main `CaeriusNet` NuGet
package.

It is not a standalone public package. Consumers install only `CaeriusNet`; the package imports the MSBuild targets and invokes this tool from its embedded `tools/net10.0/any` assets during normal `dotnet build` commands.
It is not a standalone public package. Consumers install only `CaeriusNet`; the package imports the MSBuild targets and
invokes this tool from its embedded `tools/net10.0/any` assets during normal `dotnet build` commands.

## Consumer usage

Expand Down Expand Up @@ -54,17 +56,18 @@ If SQL Server metadata no longer matches `caerius.contracts.json`, the build fai

## Configuration

| Property | Default | Purpose |
|---|---|---|
| `CaeriusContractsMode` | `Off` | Enables `Pull`, `Verify`, or disables AutoContracts. |
| `CaeriusContractsOutput` | `$(ProjectDir)caerius.contracts.json` | Manifest path. |
| `CaeriusContractsConnectionName` | `DefaultConnection` | Named connection string from .NET configuration. |
| `CaeriusContractsConnectionStringEnv` | Empty | Environment variable that contains the SQL Server connection string. |
| `CaeriusContractsConnectionString` | Empty | Inline connection string. Prefer configuration or secrets instead. |
| `CaeriusContractsConfigurationBasePath` | `$(MSBuildProjectDirectory)` | Directory used to load configuration files. |
| `CaeriusContractsConfigurationEnvironment` | Empty | Environment suffix for `appsettings.{environment}.json`. |
| `CaeriusContractsUserSecretsId` | Project `UserSecretsId` | User secrets ID override. |
| Property | Default | Purpose |
|--------------------------------------------|---------------------------------------|----------------------------------------------------------------------|
| `CaeriusContractsMode` | `Off` | Enables `Pull`, `Verify`, or disables AutoContracts. |
| `CaeriusContractsOutput` | `$(ProjectDir)caerius.contracts.json` | Manifest path. |
| `CaeriusContractsConnectionName` | `DefaultConnection` | Named connection string from .NET configuration. |
| `CaeriusContractsConnectionStringEnv` | Empty | Environment variable that contains the SQL Server connection string. |
| `CaeriusContractsConnectionString` | Empty | Inline connection string. Prefer configuration or secrets instead. |
| `CaeriusContractsConfigurationBasePath` | `$(MSBuildProjectDirectory)` | Directory used to load configuration files. |
| `CaeriusContractsConfigurationEnvironment` | Empty | Environment suffix for `appsettings.{environment}.json`. |
| `CaeriusContractsUserSecretsId` | Project `UserSecretsId` | User secrets ID override. |

## Read-only behavior

AutoContracts reads SQL Server metadata only. It does not create, update, or delete database objects, and it does not inspect table data.
AutoContracts reads SQL Server metadata only. It does not create, update, or delete database objects, and it does not
inspect table data.
Loading