Skip to main content

Migration Guides

v10.1.0 → v10.2.0​

This release is additive. It adds IbanConverter so the IBAN value object introduced in RA.Utilities.Core.ValueObjects 10.2.0 can be persisted like the other value objects. No existing type, method signature, or registration changed.

What's new​

TypeChange
RA.Utilities.Data.EntityFramework.Conventions.IbanConverterNew ValueConverter<IBAN, string>
RA.Utilities.Core.ValueObjects dependencyUpdated to 10.2.0 (adds IBAN)
RA.Utilities.Data.Abstractions dependencyUpdated to 10.0.5
RA.Utilities.Data.Entities10.1.2 (transitive)

Why this change?​

IBAN is a new value object in RA.Utilities.Core.ValueObjects 10.2.0. EF Core cannot map a custom type without a converter, so the package now ships IbanConverter alongside EmailConverter, CurrencyConverter, SsnConverter, and MoneyConverter.

The converter writes the normalized value (GB82WEST12345698765432) and reads through new IBAN(value), so structural and ISO 7064 check-digit validation run on materialization exactly as they do for the other string-backed value objects.

Migration steps​

1. Upgrade both packages​

dotnet add package RA.Utilities.Data.EntityFramework --version 10.2.0
dotnet add package RA.Utilities.Core.ValueObjects --version 10.2.0

2. Configure IBAN properties​

Per property:

using RA.Utilities.Data.EntityFramework.Conventions;

builder.Property(c => c.Iban).HasConversion(new IbanConverter());

Or model-wide:

protected override void ConfigureConventions(ModelConfigurationBuilder configurationBuilder)
{
configurationBuilder.Properties<IBAN>().HaveConversion<IbanConverter>();
}

3. Size the column​

An IBAN is at most 34 characters. Configure an appropriate maximum length (and uniqueness, if the account must be unique) rather than relying on the provider default:

builder.Property(c => c.Iban)
.HasConversion(new IbanConverter())
.HasMaxLength(34);
Existing data

The converter validates on read. If a column already contains values that are not valid IBANs (wrong checksum, malformed structure), materializing those rows throws BadRequestException. Clean the data or migrate it before enabling the converter.

Breaking changes​

None. IbanConverter is new, and the dependency update does not change existing behavior.


v10.0.2 → v10.1.0​

Breaking Change: None for call sites​

The DependencyInjectionExtensions class is renamed to ServiceCollectionExtensions — it now holds only the repository registration extensions (AddRepositoryBase(), AddReadRepositoryBase(), AddWriteRepositoryBase()). Together with MoneyConventionExtensions, the methods are re-implemented as C# 14 extension members (extension blocks). Method names, signatures, and the RA.Utilities.Data.EntityFramework.Extensions namespace are unchanged.

Why this change?​

The rename follows the classic ASP.NET Core ServiceCollectionExtensions naming convention used across the RA.Utilities packages, so the class name states exactly what it extends: the service registration extensions for IServiceCollection.

What changed​

Aspectv10.0.2v10.1.0
AddRepositoryBase() / AddReadRepositoryBase() / AddWriteRepositoryBase() declared inDependencyInjectionExtensionsServiceCollectionExtensions
HasMoney() declared inMoneyConventionExtensionsMoneyConventionExtensions (name unchanged)
Method names / signatures—unchanged
Implementation styleclassic extension methodsC# 14 extension blocks

Migration Steps​

1. No code changes required for consuming projects​

These are extension methods — they are resolved by the compiler based on the target type (IServiceCollection, EntityTypeBuilder<T>), not the static class name. The using directive is unchanged:

// ✅ This code is unchanged in v10.1.0
using RA.Utilities.Data.EntityFramework.Extensions;

builder.Services.AddRepositoryBase(); // Resolved on IServiceCollection
builder.Services.AddReadRepositoryBase();
builder.Services.AddWriteRepositoryBase();

2. Update direct class name references (if any)​

Only references to the class name itself need updating. Receiver-style calls keep working, and static calls also keep working once they use the new class name:

// ❌ v10.0.2
typeof(DependencyInjectionExtensions)
DependencyInjectionExtensions.AddRepositoryBase(services)

// ✅ v10.1.0
typeof(ServiceCollectionExtensions)
ServiceCollectionExtensions.AddRepositoryBase(services)

Full Changelog​

See the package release notes for a complete version history.