Skip to content

Releases: TylerBrinkley/Enums.NET

5.0.0

03 May 03:56
1ce2a88
Compare
Choose a tag to compare

What's Changed

  • Removed Boolean enum support and dropped support for net45 and bumped it to net461 due to updating dependencies.
  • Also dropped support for netstandard 1.x tfms for similar reasons.
  • Added a net7 target which utilizes the built-in generic number interfaces.
  • Also added an EnumValidatorAttribute base class since generic attributes are now supported.

4.0.2

17 Jan 15:03
6ef93d0
Compare
Choose a tag to compare

Fix

  • Fixed flag enumeration infinite loop issue on AsString and TryFormat for certain inputs.

4.0.1

19 Nov 16:03
a35664d
Compare
Choose a tag to compare

Fix

  • Fixed flag enumeration infinite loop issue for certain invalid inputs.

4.0.0

30 Jan 01:45
b32859f
Compare
Choose a tag to compare

It is recommended if upgrading from 2.x and below to update to 3.x first and follow the warnings to migrate any code that's using deprecated methods and classes.

New Features

  • Added support for the TryFormat methods for serializing to a Span<char>.

Breaking Changes

  • Removed NonGenericEnums, NonGenericFlagEnums, UnsafeEnums, and UnsafeFlagEnums classes which were deprecated in v3.0 and also removed all other deprecated methods in an effort to slim the library size down.
  • A dependency on the System.Runtime.CompilerServices.Unsafe package was added for the .NET 4.5 target in order to remove a build dependency on Fody.

3.0.3

23 Jan 16:59
Compare
Choose a tag to compare
  • Fix infinite loop when enumerating unsigned enum flags that are near the underlying type's max value.

3.0.2

06 Dec 17:11
Compare
Choose a tag to compare
  • Improved flag bitwise operations performance to only about 20% slower than native.

3.0.1

11 Nov 20:56
Compare
Choose a tag to compare
  • Improved parsing performance.
  • Fixed empty string flag parsing bug.

3.0.0

02 Nov 02:16
Compare
Choose a tag to compare

New Features

  • Added C# 8 nullable reference annotations throughout.
  • Reduced default memory usage by over 83% by minimizing generic code over the enum type, due to value type generic argument code explosion.
  • Improved performance throughout.
  • Added ReadOnlySpan<char> parsing support when targeting .NET Core 3.0+.

Breaking Changes

  • GetNames, GetValues, GetMembers, GetFlags, and GetFlagMembers now all return an IReadOnlyList<T> instead of IEnumerable<T>.
  • Since IReadOnlyList<T> was added in .NET Framework 4.5, support for prior .NET Framework versions has been removed.
  • .NET Standard builds now depend on the System.Runtime.CompilerServices.Unsafe package for efficient conversions between the enum and its underlying type instead of relying on Fody to implement that.
  • NonGenericEnums, NonGenericFlagEnums, UnsafeEnums, and UnsafeFlagEnums are now deprecated and will be removed in v4.0. The equivalent methods have been added to the Enums and FlagEnums classes with the unsafe versions having the suffix of Unsafe to avoid a naming conflict with the type-safe versions. This was done to better match System.Enum and provide better discoverability being more centralized. I've created the C# roslyn analyzer Enums.NET.Analyzer which provides a code fix to migrate your usages of the non-generic and unsafe methods to the new methods.
  • Nullable enum types are not supported in the new non-generic methods but are still supported when using NonGenericEnums and NonGenericFlagEnums.
  • Deprecated many convenience method overloads as there were getting to be too many and will be removed in v4.0.
  • NonGenericEnumComparer and UnsafeEnumComparer were removed, use EnumComparer.GetInstance and EnumComparer<TEnum>.Instance instead. EnumComparer<TEnum>'s TEnum type argument is no longer constrained to struct, Enum to support this.
  • A few TryToObject overloads were removed due to there being too many convenience method overloads.

2.3.2

23 Jun 03:07
Compare
Choose a tag to compare

New Features

  • Added SourceLink support.
  • Enhanced Unity compatibility with AOT compilation.
  • Uses C# 7.3's built-in support for the Enum constraint.

2.3.1

18 Dec 15:29
Compare
Choose a tag to compare

Fix

  • Fixed issue with using Enums.NET from a .NET Standard or .NET Core 1.x project.