-
Notifications
You must be signed in to change notification settings - Fork 22
Changes & Breaking Changes
Make sure to take a look, and feel free to open an issue if you don't agree with the change.
- Version 9 is out!
- Added modular model and mapping configuration from service provider here and here.
[Breaking Changes]
- MapperOptionsBuilder and EntityMapperOptionsBuilder were added to standarize and improve the code. This may break some usings and ConfigureMapper method in DbContext (if you use that old way of configuring).
- Various internal namespace fixes, it may break some "using" if the library was hacked (not used in the traditional way).
- Map many objects at the same time, load them all in a single query.
TODO for next version:
- Documentation for Foreign Key Mapping.
- Clone MapperOptions (so profiles can start from a copy of Default)
- New Annotations ([MapTo], [MapFrom], [DiscriminatorName] and [DiscriminatorValue])
- Fixed an old debt with a test
- Tidy up more tests and test names
- UseDetached (deprecated) was removed in favor of UseMapping (breaking change!)
- MapperOptions.Configure (deprecated) was removed in favor of MapperOptions.Type (breaking change!)
- EntityMapperOptionsBuilder was removed and EntityMapperOptions is being used directly now (breaking change!)
- Conventions now are being applied after the type is configured (may break some unknown scenario?)
- Annotations refactored to be easier to handle.
- Tests renaming and tidy up.
- Unified mapper cache and merged two GetOrAdd to one (internal, may break if you hacked it?)
- New UseMapping signature that receives EntityMapperOptions instead of Action.
- IPropertyNameConvention changed to IMemberNameConvention (breaking change!)
[New features]
-
Map foreign keys to the primary key of the associated entity. Check here.
-
UseMapping overload with a single EntityMapperOptions instead of a delegate.
-
Default() is not needed anymore since EntityMapperOptions now inherits from MapperOptions. It will be deprecated and deleted at some point.
-
IMemberNameConvention allows to add multiple named conventions, the first one in returning a name, wins. Adding CamelCaseMemberNameConvention to MapperOptions allows to map sources in camel case to targets in pascal case, but if you don't remove DefaultMemberNameConvention, it gets applied after, which leads to a kind of ignore-case.
- Multiframework: 6, 7 & 8 supported
- New CI/CD using Github actions
- Dropped support for netstandard. All the target frameworks are now "net8.0".
Breaking changes! Only if you customized internal components. Otherwise it should work out of the box.
-
IMapContext.TrackChange was removed an the EF specific code was moved to new mappers in Mappers.EntityFramework.
-
Added new concept: Bind. It is a mapping as a single expression created specially for Projections. Now Projections has features similar to Mapping, like inheritance and property renaming. The idea is to fix some bugs and extend it even more.
- UseDetached() marked as obsolete. Please use UseMapping() instead.
- Internal EF classes renamed: e.g. EFMapper is now EntityMapper. That might break something if the library has been extended/hacked.
- Profile management configuration refactor.
- MapParameters updated:
- Upsert -> MissingRootBehavior
- AddAggregations -> MissingAggregationBehavior
- AssociateExistingCompositions -> ExistingCompositionBehavior Added CompositeCollectionBehavior.
- [NotMapped] won't be handled anymore. Please replace it by [MapIgnore]. Also .NotMapped() fluent extension was changed to .Ignore().