Releases: TylerBrinkley/Enums.NET
Releases · TylerBrinkley/Enums.NET
5.0.0
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
Fix
- Fixed flag enumeration infinite loop issue on
AsString
andTryFormat
for certain inputs.
4.0.1
Fix
- Fixed flag enumeration infinite loop issue for certain invalid inputs.
4.0.0
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 aSpan<char>
.
Breaking Changes
- Removed
NonGenericEnums
,NonGenericFlagEnums
,UnsafeEnums
, andUnsafeFlagEnums
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 onFody
.
3.0.3
- Fix infinite loop when enumerating unsigned enum flags that are near the underlying type's max value.
3.0.2
- Improved flag bitwise operations performance to only about 20% slower than native.
3.0.1
- Improved parsing performance.
- Fixed empty string flag parsing bug.
3.0.0
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
, andGetFlagMembers
now all return anIReadOnlyList<T>
instead ofIEnumerable<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
, andUnsafeFlagEnums
are now deprecated and will be removed in v4.0. The equivalent methods have been added to theEnums
andFlagEnums
classes with the unsafe versions having the suffix ofUnsafe
to avoid a naming conflict with the type-safe versions. This was done to better matchSystem.Enum
and provide better discoverability being more centralized. I've created the C# roslyn analyzerEnums.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
andNonGenericFlagEnums
. - Deprecated many convenience method overloads as there were getting to be too many and will be removed in v4.0.
NonGenericEnumComparer
andUnsafeEnumComparer
were removed, useEnumComparer.GetInstance
andEnumComparer<TEnum>.Instance
instead.EnumComparer<TEnum>
'sTEnum
type argument is no longer constrained tostruct, Enum
to support this.- A few
TryToObject
overloads were removed due to there being too many convenience method overloads.
2.3.2
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
Fix
- Fixed issue with using
Enums.NET
from a .NET Standard or .NET Core 1.x project.