Release Notes
10.0.0
Targets .NET 10. Contains breaking changes.
Breaking Changes
Albatross.EFCore.ChangeReporting
ChangeReportDbEventHandler<T> has been redesigned. The mutable ChangeReportingOptions class has been removed. All configuration is now done via required init properties directly on the handler, built through ChangeReportBuilder<T>.
The following ChangeReportBuilder<T> extension methods have been removed:
ChangeType,FixedHeaders,IgnoreProperties,OnReportGeneratedPrefix,PostfixFormatter,AsyncFormatter,Format,FormatFixedHeaderNumericFormat,DateFormat,TimeFormatDeleted,Modified,Added,AllChangeTypes
The remaining extension methods are ExcludeAuditProperties and ExcludeTemporalProperties.
IChangeReport and ChangeReportingOptions have been removed.
Text generation is now synchronous — BuildText returns string instead of Task<string>.
Albatross.EFCore.CodeGen
The source generator has been rewritten as an incremental generator (IIncrementalGenerator). The previous EntityModelBuilderClassCodeGen and EntityModelClassWalker classes have been replaced by EntityModelBuilderClassCodeGenerator. Generated output and behavior are unchanged.
Albatross.EFCore.Testing (removed)
The Albatross.Testing.EFCore package has been removed.
New Features
Albatross.EFCore — Repository Pattern
A new IRepository interface and Repository<T> abstract base class have been added.
IRepositoryexposesAdd<T>,Delete<T>, andSaveChangesAsyncSaveChangesAsyncreturns aSaveResultsrecord withSuccess,NameConflict,ForeignKeyConflict, andError— no exception is thrown on constraint violationsRepository<T>requires subclasses to implementIsUniqueConstraintViolationandIsForeignKeyConstraintViolation
Albatross.EFCore.SqlServer — Constraint Violation Helpers
Two extension methods on Exception have been added:
IsUniqueConstraintViolation()— detects SQL errors 2601 and 2627IsForeignKeyConstraintViolation()— detects SQL error 547
Albatross.EFCore.PostgreSQL — Constraint Violation Helpers
Two extension methods on Exception have been added:
IsUniqueConstraintViolation()— detectsSqlState23505IsForeignKeyConstraintViolation()— detectsSqlState23503
8.1.2
- Documentation updates
- Minor internal fixes