FastEnum
FastEnum copied to clipboard
The world fastest enum utilities for C#/.NET
`GetEnumMemberValue` and `GetLabel` are fantastic for mapping from an enum value to a string. Is there any means to do it the other way around (i.e. map from the enum...
First, thank you for this remarkable utility. Do you plan to introduce 'ReadOnlySpan' as string parameter?
Hi, This PR is adding **fast** GetAttribute methods. # How to use ```csharp //from Member Fruits.Apple.ToMember().GetAttribute()?.Description; //Direct: it is little bit faster, but verbose(`
FastEnum: 1.8.0 .Net Framework 4.7.2 .NET version: latest ```C# public enum ErpMethod { [EnumMember(Value = "A. ")] A, [EnumMember(Value = "B. ")] B, [EnumMember(Value = "C. ")] C, [EnumMember(Value =...
```cs using System; using System.Net; using FastEnumUtility; var stopWatch = System.Diagnostics.Stopwatch.StartNew(); FastEnum.IsContinuous(); stopWatch.Stop(); Console.WriteLine(stopWatch.ElapsedTicks / 10000d); stopWatch.Restart(); FastEnum.IsContinuous(); stopWatch.Stop(); Console.WriteLine(stopWatch.ElapsedTicks / 10000d); stopWatch.Restart(); FastEnum.IsContinuous(); stopWatch.Stop(); Console.WriteLine(stopWatch.ElapsedTicks / 10000d); stopWatch.Restart(); FastEnum.IsContinuous();...
### Description: Please consider implementing a new method that allows retrieving the description of an enum field when using the `[Description]` attribute. This feature is particularly useful when you do...
https://github.com/xin9le/FastEnum/blob/db9a3796b48dc460bd24cb4ce1e825e37093bee0/src/libs/FastEnum.Core/Internals/EnumInfo.cs#L25 As far as I can see, s_memberByValue is unnecessary when EnumInfo.s_isContinuous.
For [Enum.GetValues](https://learn.microsoft.com/en-us/dotnet/api/system.enum.getvalues?view=net-9.0) and [GetNames](https://learn.microsoft.com/en-us/dotnet/api/system.enum.getnames?view=net-9.0) , the elements of each array are sorted by the binary values. Therefore, ~~continuity checks should be performed after casting to unsigned~~, and minimum and maximum...