-
-
Notifications
You must be signed in to change notification settings - Fork 155
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: custom enum naming strategies (#1486)
* feat: custom enum naming strategies --------- Co-authored-by: latonz <lars@riok.ch>
- Loading branch information
Showing
26 changed files
with
1,147 additions
and
117 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
namespace Riok.Mapperly.Abstractions; | ||
|
||
/// <summary> | ||
/// Defines the strategy to use when mapping an enum from/to string. | ||
/// </summary> | ||
public enum EnumNamingStrategy | ||
{ | ||
/// <summary> | ||
/// Matches enum values using their name. | ||
/// </summary> | ||
MemberName, | ||
|
||
/// <summary> | ||
/// Matches enum values using camelCase. | ||
/// </summary> | ||
CamelCase, | ||
|
||
/// <summary> | ||
/// Matches enum values using PascalCase. | ||
/// </summary> | ||
PascalCase, | ||
|
||
/// <summary> | ||
/// Matches enum values using snake_case. | ||
/// </summary> | ||
SnakeCase, | ||
|
||
/// <summary> | ||
/// Matches enum values using UPPER_SNAKE_CASE. | ||
/// </summary> | ||
UpperSnakeCase, | ||
|
||
/// <summary> | ||
/// Matches enum values using kebab-case. | ||
/// </summary> | ||
KebabCase, | ||
|
||
/// <summary> | ||
/// Matches enum values using UPPER-KEBAB-CASE. | ||
/// </summary> | ||
UpperKebabCase, | ||
} |
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
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
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
Oops, something went wrong.