Skip to content

Commit ec0e052

Browse files
committed
Add UsePascalCase setting for Enum members
1 parent cf68c6f commit ec0e052

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

Generator/Readers/DatabaseReader.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -815,7 +815,7 @@ public List<Enumeration> ReadEnums(List<EnumerationSettings> enums)
815815
continue;
816816

817817
name = RemoveNonAlphanumerics.Replace(name, string.Empty);
818-
name = Inflector.ToTitleCase(name).Replace(" ", "").Trim();
818+
name = (Settings.UsePascalCaseForEnumMembers ? Inflector.ToTitleCase(name) : name).Replace(" ", string.Empty).Trim();
819819
if (string.IsNullOrEmpty(name))
820820
continue;
821821

Generator/Settings.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ public static class Settings
4646
public static string ResultClassModifiers = "public"; // "public partial";
4747

4848
public static bool UsePascalCase = true; // This will rename the generated C# tables & properties to use PascalCase. If false table & property names will be left alone.
49+
public static bool UsePascalCaseForEnumMembers = true; // This will rename the generated Enum Members to use PascalCase. If false Enum members will be left alone.
4950
public static bool UseDataAnnotations = false; // If true, will add data annotations to the poco classes.
5051
public static bool UsePropertyInitialisers = false; // Removes POCO constructor and instead uses C# 6 property initialisers to set defaults
5152
public static bool UseLazyLoading = true; // Marks all navigation properties as virtual or not, to support or disable EF Lazy Loading feature

0 commit comments

Comments
 (0)