Skip to content

7.0.0

Compare
Choose a tag to compare
@PawelGerr PawelGerr released this 10 Dec 12:27
· 186 commits to master since this release
6c704ee
  • See Migration from v6 to v7
  • [BREAKING] Use SmartEnumAttribute<T> instead of IEnum<T>/IValidatableEnum<T>
  • [BREAKING] Smart Enums and Value Object are using (custom) ValidationError instead of ValidationResult
    • Use ValueObjectValidationErrorAttribute<TError> to define the type of a custom validation error
  • The names of the factory methods Create and TryCreate can be changed.
  • Added support for keyless Smart Enums
  • [BREAKING] Split ValueObjectAttribute in keyed ValueObjectAttribute<T> and ComplexValueObject
    • Key member is implemented by the source generator by default.
    • Key member generation can be disabled via SkipKeyMember
    • Attribute property KeyPropertyName has been renamed to KeyMemberName
    • Key member can be renamed via attribute-property KeyMemberName
    • Access modifier of the key member can be configured via KeyMemberAccessModifier
    • Key member kind can be configured via KeyMemberKind
    • Key member comparers can be configured via ValueObjectKeyMemberComparerAttribute and ValueObjectKeyMemberEqualityComparerAttribute
    • IEnum<TKey>.KeyEqualityComparer has been replaced by ValueObjectKeyMemberEqualityComparerAttribute
    • default (equality) comparer of string-based keyed value object is OrdinalIgnoreCase (as with Smart Enums)
  • Added support for EF Core 8
    • [BREAKING] Renamed extension method AddEnumAndValueObjectConverters to AddValueObjectConverters
  • [C# 12] Analyzer prevents the usage of primary constructors with Smart Enums and Value Objects.
  • Json converter for complex value object uses converters instead of reader/writer, this is approach is better because it supports custom converters.
  • Several performance optimizations