Skip to content

Commit

Permalink
Merge pull request #51 from Avanade/v2.6.1
Browse files Browse the repository at this point in the history
v2.6.1
  • Loading branch information
chullybun authored Oct 24, 2024
2 parents 3b8859d + 1cb301f commit 5cd46db
Show file tree
Hide file tree
Showing 34 changed files with 69 additions and 147 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

Represents the **NuGet** versions.

## v2.6.1
- *Fixed:* As a result of the `v2.6.0` enhancements the generated `IdentifierMappingMapper.cs` and `VersionTrackingMapper.cs` are not required. This fix will ensure these files are no longer generated; as such these should be removed from any existing solution after a re-gen.
- *Fixed:* The base `EntityOrchestrator` classes have also been corrected to remove the `IdentifierMappingMapper` and `VersionTrackingMapper` references.

## v2.6.0
- *Enhancement:* Database code-generation defaults to the use of [JSON](https://learn.microsoft.com/en-us/sql/relational-databases/json/json-data-sql-server)-serialized parameters versus UDT/TVP to minimize the need for additional database objects; specifically [User-Defined Types](https://learn.microsoft.com/en-us/sql/t-sql/statements/create-type-transact-sql) (UDT).
- This will now require a SQL Server version of 2016 or later; use earlier _DbEx_ versions that use UDT/TVP which are supported on earlier SQL Server versions.
Expand Down
2 changes: 1 addition & 1 deletion Common.targets
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project>
<PropertyGroup>
<Version>2.6.0</Version>
<Version>2.6.1</Version>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<Authors>NTangle Developers</Authors>
<Company>Avanade</Company>
Expand Down
5 changes: 0 additions & 5 deletions docs/SqlServer.md
Original file line number Diff line number Diff line change
Expand Up @@ -213,9 +213,6 @@ Table | [`EventOutbox`](../samples/SqlServerDemo/SqlServerDemo.Database/Migratio
Table | [`EventOutboxData`](../samples/SqlServerDemo/SqlServerDemo.Database/Migrations/20221107-232848-06-create-outbox-eventoutboxdata-table.sql) | Event outbox data.
Table | [`IdentifierMapping`](../samples/SqlServerDemo/SqlServerDemo.Database/Migrations/20221107-232848-07-create-ntangle-identifiermapping-table.sql) | Identifier mapping.
Table | [`VersionTracking`](../samples/SqlServerDemo/SqlServerDemo.Database/Migrations/20221107-232848-02-create-ntangle-versiontracking-table.sql) | Version (hash) tracking.
UDT | [`udtEventOutboxList`](../samples/SqlServerDemo/SqlServerDemo.Database/Schema/Outbox/Types/User-Defined%20Table%20Types/Generated/udtEventOutboxList.sql) | Event outbox list user-defined type.
UDT | [`udtIdentifierMappingList`](../samples/SqlServerDemo/SqlServerDemo.Database/Schema/NTangle/Types/User-Defined%20Table%20Types/Generated/udtIdentifierMappingList.sql) | Identifier mapping list user-defined type.
UDT | [`udtVersionTrackingList`](../samples/SqlServerDemo/SqlServerDemo.Database/Schema/NTangle/Types/User-Defined%20Table%20Types/Generated/udtVersionTrackingList.sql) | Version tracking list user-defined type.

<br/>

Expand All @@ -230,7 +227,5 @@ Namespace | Artefact | Description
Data | [`XxxOrchestrator`](../samples/SqlServerDemo/SqlServerDemo.Publisher/Data/Generated/ContactOrchestrator.cs) | Change tracking and event publisher orchestrator.
Data | [`EventOutboxDequeue`](../samples/SqlServerDemo/SqlServerDemo.Publisher/Data/Generated/EventOutboxDequeue.cs) | Event outbox dequeue.
Data | [`EventOutboxEnqueue`](../samples/SqlServerDemo/SqlServerDemo.Publisher/Data/Generated/EventOutboxEnqueue.cs) | Event outbox enqueue.
Data | [`IdentifierMappingMapper`](../samples/SqlServerDemo/SqlServerDemo.Publisher/Data/Generated/IdentifierMappingMapper.cs) | Identifier mapping database to .NET mapper.
Data | [`VersionTrackingMapper`](../samples/SqlServerDemo/SqlServerDemo.Publisher/Data/Generated/VersionTrackingMapper.cs) | Version tracking database to .NET mapper.
Entities | [`XxxCdc`](../samples/SqlServerDemo/SqlServerDemo.Publisher/Entities/Generated/ContactCdc.cs) | Entity (aggregate root) representation of database table(s) and relationships.
Services | [`XxxHostedService`](../samples/SqlServerDemo/SqlServerDemo.Publisher/Services/Generated/ContactHostedService.cs) | Timer-based host for the `XxxCdcOrchestrator`.
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="DbEx.SqlServer" Version="2.6.1" />
<PackageReference Include="DbEx.SqlServer" Version="2.7.1" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,11 @@
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</ItemGroup> <ItemGroup>
<PackageReference Include="CoreEx.Azure" Version="3.25.6" />
<PackageReference Include="CoreEx.Database.SqlServer" Version="3.25.6" />
<PackageReference Include="CoreEx.Validation" Version="3.25.6" />
<PackageReference Include="CoreEx.Azure" Version="3.27.3" />
<PackageReference Include="CoreEx.Database.SqlServer" Version="3.27.3" />
<PackageReference Include="CoreEx.Validation" Version="3.27.3" />
<PackageReference Include="Microsoft.Azure.Functions.Extensions" Version="1.1.0" />
<PackageReference Include="Microsoft.Azure.WebJobs.Extensions.ServiceBus" Version="5.16.4" />
<PackageReference Include="Microsoft.NET.Sdk.Functions" Version="4.3.0" />
<PackageReference Include="Microsoft.NET.Sdk.Functions" Version="4.5.0" />
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="DbEx.SqlServer" Version="2.6.1" />
<PackageReference Include="DbEx.SqlServer" Version="2.7.1" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@
<Folder Include="Entities\" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="CoreEx.Azure" Version="3.25.6" />
<PackageReference Include="CoreEx.Azure" Version="3.27.3" />
<PackageReference Include="Microsoft.Azure.Functions.Extensions" Version="1.1.0" />
<PackageReference Include="Microsoft.Azure.WebJobs.Extensions.ServiceBus" Version="5.16.4" />
<PackageReference Include="Microsoft.NET.Sdk.Functions" Version="4.3.0" />
<PackageReference Include="Microsoft.NET.Sdk.Functions" Version="4.5.0" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\..\..\src\NTangle\NTangle.csproj" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public partial interface IContactOrchestrator : IEntityOrchestrator<ContactCdc>
/// <summary>
/// Manages the Change Data Capture (CDC) <see cref="ContactCdc"/> entity (aggregate root) orchestration (database table '[old].[Contact]').
/// </summary>
public partial class ContactOrchestrator : EntityOrchestrator<ContactCdc, ContactOrchestrator.ContactCdcEnvelopeCollection, ContactOrchestrator.ContactCdcEnvelope, VersionTrackingMapper>, IContactOrchestrator
public partial class ContactOrchestrator : EntityOrchestrator<ContactCdc, ContactOrchestrator.ContactCdcEnvelopeCollection, ContactOrchestrator.ContactCdcEnvelope>, IContactOrchestrator
{
private static readonly ContactCdcMapper _contactCdcMapper = new();
private static readonly AddressCdcMapper _addressCdcMapper = new();
Expand Down

This file was deleted.

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

<ItemGroup>
<PackageReference Include="DbEx.SqlServer" Version="2.6.1" />
<PackageReference Include="DbEx.SqlServer" Version="2.7.1" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public partial interface IContactOrchestrator : IEntityOrchestrator<ContactCdc>
/// <summary>
/// Manages the Change Data Capture (CDC) <see cref="ContactCdc"/> entity (aggregate root) orchestration (database table '[Legacy].[Contact]').
/// </summary>
public partial class ContactOrchestrator : EntityOrchestrator<ContactCdc, ContactOrchestrator.ContactCdcEnvelopeCollection, ContactOrchestrator.ContactCdcEnvelope, VersionTrackingMapper, string>, IContactOrchestrator
public partial class ContactOrchestrator : EntityOrchestrator<ContactCdc, ContactOrchestrator.ContactCdcEnvelopeCollection, ContactOrchestrator.ContactCdcEnvelope, string>, IContactOrchestrator
{
private static readonly ContactCdcMapper _contactCdcMapper = new();
private static readonly AddressCdcMapper _addressCdcMapper = new();
Expand All @@ -27,7 +27,7 @@ public partial class ContactOrchestrator : EntityOrchestrator<ContactCdc, Contac
/// <param name="logger">The <see cref="ILogger"/>.</param>
/// <param name="idGen">The <see cref="IIdentifierGenerator{T}"/>.</param>
public ContactOrchestrator(IDatabase db, IEventPublisher eventPublisher, IJsonSerializer jsonSerializer, SettingsBase settings, ILogger<ContactOrchestrator> logger, IIdentifierGenerator<string> idGen) :
base(db, "[NTangle].[spContactBatchExecute]", "[NTangle].[spContactBatchComplete]", eventPublisher, jsonSerializer, settings, logger, "[NTangle].[spIdentifierMappingCreate]", idGen, new IdentifierMappingMapper<string>()) => ContactOrchestratorCtor();
base(db, "[NTangle].[spContactBatchExecute]", "[NTangle].[spContactBatchComplete]", eventPublisher, jsonSerializer, settings, logger, "[NTangle].[spIdentifierMappingCreate]", idGen) => ContactOrchestratorCtor();

partial void ContactOrchestratorCtor(); // Enables additional functionality to be added to the constructor.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public partial interface ICustomerOrchestrator : IEntityOrchestrator<CustomerCdc
/// <summary>
/// Manages the Change Data Capture (CDC) <see cref="CustomerCdc"/> entity (aggregate root) orchestration (database table '[Legacy].[Customer]').
/// </summary>
public partial class CustomerOrchestrator : EntityOrchestrator<CustomerCdc, CustomerOrchestrator.CustomerCdcEnvelopeCollection, CustomerOrchestrator.CustomerCdcEnvelope, VersionTrackingMapper>, ICustomerOrchestrator
public partial class CustomerOrchestrator : EntityOrchestrator<CustomerCdc, CustomerOrchestrator.CustomerCdcEnvelopeCollection, CustomerOrchestrator.CustomerCdcEnvelope>, ICustomerOrchestrator
{
private static readonly CustomerCdcMapper _customerCdcMapper = new();

Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public partial interface IPostOrchestrator : IEntityOrchestrator<PostCdc> { }
/// <summary>
/// Manages the Change Data Capture (CDC) <see cref="PostCdc"/> entity (aggregate root) orchestration (database table '[Legacy].[Posts]').
/// </summary>
public partial class PostOrchestrator : EntityOrchestrator<PostCdc, PostOrchestrator.PostCdcEnvelopeCollection, PostOrchestrator.PostCdcEnvelope, VersionTrackingMapper>, IPostOrchestrator
public partial class PostOrchestrator : EntityOrchestrator<PostCdc, PostOrchestrator.PostCdcEnvelopeCollection, PostOrchestrator.PostCdcEnvelope>, IPostOrchestrator
{
private static readonly PostCdcMapper _postCdcMapper = new();
private static readonly CommentCdcMapper _commentCdcMapper = new();
Expand Down

This file was deleted.

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

<ItemGroup>
<PackageReference Include="CoreEx.Azure" Version="3.25.6" />
<PackageReference Include="CoreEx.Azure" Version="3.27.3" />
<PackageReference Include="Microsoft.Extensions.Hosting" Version="7.0.1" />
</ItemGroup>

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

<ItemGroup>
<PackageReference Include="DbEx.SqlServer" Version="2.6.1" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.9.0" />
<PackageReference Include="DbEx.SqlServer" Version="2.7.1" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.11.1" />
<PackageReference Include="NUnit" Version="3.13.3" />
<PackageReference Include="NUnit3TestAdapter" Version="4.5.0" />
<PackageReference Include="NUnit3TestAdapter" Version="4.6.0" />
<PackageReference Include="coverlet.collector" Version="6.0.2">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
Expand Down
3 changes: 2 additions & 1 deletion src/NTangle/Cdc/BatchTracker.cs
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
// Copyright (c) Avanade. Licensed under the MIT License. See https://github.com/Avanade/NTangle

using CoreEx.Entities;
using System;

namespace NTangle.Cdc
{
/// <summary>
/// Represents the CDC (Change Data Capture) batch tracker.
/// </summary>
public class BatchTracker
public class BatchTracker : IIdentifier<long>
{
/// <summary>
/// Gets or sets the batch identifer.
Expand Down
4 changes: 1 addition & 3 deletions src/NTangle/Cdc/EntityOrchestrator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,16 @@ namespace NTangle.Cdc
/// <typeparam name="TEntity">The root entity <see cref="Type"/>.</typeparam>
/// <typeparam name="TEntityEnvelopeColl">The <typeparamref name="TEntityEnvelope"/> collection <see cref="Type"/>.</typeparam>
/// <typeparam name="TEntityEnvelope">The <typeparamref name="TEntity"/> envelope <see cref="Type"/>.</typeparam>
/// <typeparam name="TVersionTrackerMapper">The <see cref="VersionTracker"/> database mapper <see cref="Type"/>.</typeparam>
/// <param name="db">The <see cref="IDatabase"/>.</param>
/// <param name="executeStoredProcedureName">The name of the batch execute stored procedure.</param>
/// <param name="completeStoredProcedureName">The name of the batch complete stored procedure.</param>
/// <param name="eventPublisher">The <see cref="IEventPublisher"/>.</param>
/// <param name="jsonSerializer">The <see cref="IJsonSerializer"/>.</param>
/// <param name="settings">The <see cref="SettingsBase"/>.</param>
/// <param name="logger">The <see cref="ILogger"/>.</param>
public abstract class EntityOrchestrator<TEntity, TEntityEnvelopeColl, TEntityEnvelope, TVersionTrackerMapper>(IDatabase db, string executeStoredProcedureName, string completeStoredProcedureName, IEventPublisher eventPublisher, IJsonSerializer jsonSerializer, SettingsBase settings, ILogger logger) : EntityOrchestratorBase<TEntity, TEntityEnvelopeColl, TEntityEnvelope, TVersionTrackerMapper>(db, executeStoredProcedureName, completeStoredProcedureName, eventPublisher, jsonSerializer, settings, logger), IEntityOrchestrator<TEntity>
public abstract class EntityOrchestrator<TEntity, TEntityEnvelopeColl, TEntityEnvelope>(IDatabase db, string executeStoredProcedureName, string completeStoredProcedureName, IEventPublisher eventPublisher, IJsonSerializer jsonSerializer, SettingsBase settings, ILogger logger) : EntityOrchestratorBase<TEntity, TEntityEnvelopeColl, TEntityEnvelope>(db, executeStoredProcedureName, completeStoredProcedureName, eventPublisher, jsonSerializer, settings, logger), IEntityOrchestrator<TEntity>
where TEntity : class, IEntity, new()
where TEntityEnvelopeColl : List<TEntityEnvelope>, new()
where TEntityEnvelope : class, TEntity, IEntityEnvelope, new()
where TVersionTrackerMapper : IDatabaseMapper<VersionTracker>, new()
{ }
}
Loading

0 comments on commit 5cd46db

Please sign in to comment.