Enums.NET v3.0.0 Release Notes
Release Date: 2019-11-02 // over 4 years ago-
๐ 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.