Skip to content

Commit 800fc93

Browse files
committed
v0.8.0
1 parent e29d719 commit 800fc93

7 files changed

Lines changed: 35 additions & 57 deletions

File tree

‎.github/workflows/ci.yml‎

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -18,18 +18,7 @@ jobs:
1818
- name: Setup .NET SDK
1919
uses: actions/setup-dotnet@v6
2020
with:
21-
dotnet-version: '10.0.x'
22-
23-
- name: Show dotnet info
24-
run: dotnet --info
25-
26-
- name: Cache NuGet packages
27-
uses: actions/cache@v6
28-
with:
29-
path: ~/.nuget/packages
30-
key: nuget-${{ runner.os }}-${{ hashFiles('**/*.csproj', '**/Directory.Packages.props', '**/global.json', '**/nuget.config') }}
31-
restore-keys: |
32-
nuget-${{ runner.os }}-
21+
dotnet-version: 10.0.x
3322

3423
- name: Restore
3524
run: dotnet restore --nologo

‎README.md‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,14 @@ The DAL infrastructure supports two execution models:
2323

2424
This allows individual DAL operations to run independently while also supporting coordinated operations across multiple DAL components within the same transaction.
2525

26+
## Database Migration Model
27+
28+
The migration framework is designed for application-integrated, forward-only database evolution. Migrations are registered explicitly in the order in which they must be applied, making the target schema deterministic and avoiding reflection-based discovery.
29+
30+
Applied migrations are stored as an ordered history. Before applying pending migrations, the framework validates that the stored history is an exact prefix of the configured migration sequence. This detects removed, renamed, reordered, or unknown migrations before any schema changes are made.
31+
32+
Transaction ownership is explicit and provider-controlled. A provider can execute the complete migration batch within its own transaction or participate in an existing database context, allowing migrations and application operations to share the same transaction.
33+
2634
## Commonly Used Types
2735

2836
- **`System.Data.DalBase<TDbContext>`**: Base class for DAL implementations that supports borrowed contexts and provider-managed owned context scopes.

‎global.json‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"test": {
3+
"runner": "Microsoft.Testing.Platform"
4+
}
5+
}

‎src/NuExt.System.Data.csproj‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
<RootNamespace />
99
<GenerateDocumentationFile>True</GenerateDocumentationFile>
1010
<NoWarn>$(NoWarn);1591;NETSDK1233</NoWarn>
11-
<VersionPrefix>0.7.6</VersionPrefix>
11+
<VersionPrefix>0.8.0</VersionPrefix>
1212
</PropertyGroup>
1313

1414
<ItemGroup Condition="'$(NuExt_UseLocalProjects)' != 'true'">

‎tests/ExtensionsTests.cs‎

Lines changed: 11 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,9 @@
1-
using System.Data;
2-
3-
namespace NuExt.System.Data.Tests;
1+
namespace System.Data.Tests;
42

3+
[TestClass]
54
public class ExtensionsTests
65
{
7-
[SetUp]
8-
public void Setup()
9-
{
10-
}
11-
12-
[Test]
6+
[TestMethod]
137
public void Test1()
148
{
159
var table = new DataTable("Sample");
@@ -30,7 +24,7 @@ public void Test1()
3024
table.Rows.Add(null, $"Name{i}", null, i, null, 0);
3125
}
3226
}
33-
Assert.That(table.Rows, Has.Count.EqualTo(10));
27+
Assert.HasCount(10, table.Rows);
3428
var listTable = new List<(long Id, string Name, string? Description, int Int32Value, int? Int32NullableValue, bool BoolValue)>();
3529
foreach (DataRow row in table.Rows)
3630
{
@@ -44,22 +38,17 @@ public void Test1()
4438
));
4539
}
4640

47-
Assert.That(listTable, Has.Count.EqualTo(table.Rows.Count));
41+
Assert.HasCount(table.Rows.Count, listTable);
4842
for (int i = 0; i < table.Rows.Count; i++)
4943
{
5044
var row = table.Rows[i];
5145
var (id, name, description, int32Value, int32NullableValue, boolValue) = listTable[i];
52-
using (Assert.EnterMultipleScope())
53-
{
54-
Assert.That(row["Id"], Is.EqualTo(id));
55-
Assert.That(row["Name"], Is.EqualTo(name));
56-
Assert.That(row["Description"], Is.EqualTo(description ?? (object)DBNull.Value));
57-
Assert.That(row["Int32Value"], Is.EqualTo(int32Value));
58-
Assert.That(row["Int32NullableValue"], Is.EqualTo(int32NullableValue ?? (object)DBNull.Value));
59-
Assert.That(row["BoolValue"], Is.EqualTo(Convert.ToInt32(boolValue)));
60-
}
46+
Assert.AreEqual(id, row["Id"]);
47+
Assert.AreEqual(name, row["Name"]);
48+
Assert.AreEqual(description ?? (object)DBNull.Value, row["Description"]);
49+
Assert.AreEqual(int32Value, row["Int32Value"]);
50+
Assert.AreEqual(int32NullableValue ?? (object)DBNull.Value, row["Int32NullableValue"]);
51+
Assert.AreEqual(Convert.ToInt32(boolValue), row["BoolValue"]);
6152
}
62-
63-
Assert.Pass();
6453
}
6554
}

‎tests/GlobalSuppressions.cs‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
// This file is used by Code Analysis to maintain SuppressMessage
2+
// attributes that are applied to this project.
3+
// Project-level suppressions either have no target or are given
4+
// a specific target and scoped to a namespace, type, member, etc.
5+
6+
using System.Diagnostics.CodeAnalysis;
7+
8+
[assembly: SuppressMessage("Style", "IDE0130:Namespace does not match folder structure", Justification = "<Pending>", Scope = "namespace", Target = "~N:System.Data.Tests")]
Lines changed: 1 addition & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,13 @@
1-
<Project Sdk="Microsoft.NET.Sdk">
1+
<Project Sdk="MSTest.Sdk/4.5.1">
22

33
<PropertyGroup>
44
<TargetFrameworks>net10.0;net9.0;net8.0;net462</TargetFrameworks>
55
<ImplicitUsings>enable</ImplicitUsings>
66
<Nullable>enable</Nullable>
7-
<IsPackable>false</IsPackable>
8-
<IsTestProject>true</IsTestProject>
9-
<NoWarn>$(NoWarn);NETSDK1233</NoWarn>
107
</PropertyGroup>
118

12-
<ItemGroup>
13-
<PackageReference Include="coverlet.collector" Version="10.1.0">
14-
<PrivateAssets>all</PrivateAssets>
15-
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
16-
</PackageReference>
17-
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="18.10.1" />
18-
<PackageReference Include="NUnit" Version="5.0.0" />
19-
<PackageReference Include="NUnit.Analyzers" Version="4.15.0">
20-
<PrivateAssets>all</PrivateAssets>
21-
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
22-
</PackageReference>
23-
<PackageReference Include="NUnit3TestAdapter" Version="6.3.0" />
24-
</ItemGroup>
25-
269
<ItemGroup>
2710
<ProjectReference Include="..\src\NuExt.System.Data.csproj" />
2811
</ItemGroup>
2912

30-
<ItemGroup>
31-
<Using Include="NUnit.Framework" />
32-
</ItemGroup>
33-
3413
</Project>

0 commit comments

Comments
 (0)