-
Notifications
You must be signed in to change notification settings - Fork 48
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Handle DisplayAttribute. * Fix indentation. * Add comment. * Update the test. * Update naming. * Add System.ComponentModel.Annotations package. * Add Integration test * Fix CS8604 warning. * Fix: Warning CS8600 Converting null literal or possible null value to non - nullable type. * Remove the need of Linq * Add conditions to System.ComponentModel.Annotations * Update tests/NetEscapades.EnumGenerators.IntegrationTests/ExtensionTests.cs value.GetType() -> typeof(value) Co-authored-by: Andrew Lock <[email protected]> * Fix: typeof(value) -> typeof(T) * Remove unnecessary package. * Add allowMatchingDisplayAttribute to IsDefined. Simplify TryParse. * Add allowMatchingDisplayAttribute optsion to TryParse * Add SameDisplayName tests. * Add benchmarks. * Fix naming. * Update IsDefinedNameBenchmark * Update TryParseBenchmark * Switch from optional parameter to overload in case of IsDefined and TryParse. * Update tests * Update tests. * TryParse ignore case optimization * Update IsDefined * Update naming. Co-authored-by: Ádám Radócz <[email protected]> Co-authored-by: Andrew Lock <[email protected]>
- Loading branch information
1 parent
7907e7c
commit f97ecf5
Showing
33 changed files
with
1,501 additions
and
428 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
namespace NetEscapades.EnumGenerators; | ||
|
||
public readonly struct EnumValueOption | ||
{ | ||
/// <summary> | ||
/// Custom name setted by the <c>[Display(Name)]</c> attribute. | ||
/// </summary> | ||
public string? DisplayName { get; } | ||
public bool IsDisplayNameTheFirstPresence { get; } | ||
|
||
public EnumValueOption(string? displayName, bool isDisplayNameTheFirstPresence) | ||
{ | ||
DisplayName = displayName; | ||
IsDisplayNameTheFirstPresence = isDisplayNameTheFirstPresence; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.