We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Example implementation could be something like:
private static class LowerInvariant { public static readonly string Minute = nameof(Minute).ToLowerInvariant(); public static readonly string Hour = nameof(Hour).ToLowerInvariant(); public static readonly string Day = nameof(Day).ToLowerInvariant(); public static readonly string Week = nameof(Week).ToLowerInvariant(); public static readonly string Month = nameof(Month).ToLowerInvariant(); public static readonly string Year = nameof(Year).ToLowerInvariant(); } public static string ToLowerInvariantStringFast(this Period value) => value switch { Period.Minute => LowerInvariant.Minute, Period.Hour => LowerInvariant.Hour, Period.Day => LowerInvariant.Day, Period.Week => LowerInvariant.Week, Period.Month => LowerInvariant.Month, Period.Year => LowerInvariant.Year, _ => value.ToStringFast().ToLowerInvariant(), };
This would allow for zero allocation conversions to lower string instead of Period.Hour.ToStringFast().ToLowerInvariant().
Period.Hour.ToStringFast().ToLowerInvariant()
Same idea goes for ToUpperInvariantStringFast().
ToUpperInvariantStringFast()
The text was updated successfully, but these errors were encountered:
Great idea.
Sorry, something went wrong.
No branches or pull requests
Example implementation could be something like:
This would allow for zero allocation conversions to lower string instead of
Period.Hour.ToStringFast().ToLowerInvariant()
.Same idea goes for
ToUpperInvariantStringFast()
.The text was updated successfully, but these errors were encountered: