iluvadev / PocketBaseClient

C# client to interact with a particular PocketBase application: an ORM mapped to your PocketBase server. [This project is in active development. The things described below could change]
MIT License
43 stars 8 forks source link

Prefix for invalid Enum identifiers (e.g. numbers) #40

Closed ibanks42 closed 9 months ago

ibanks42 commented 9 months ago

Just added a quick regex check before generating Select/Enum values for identifying invalid starting characters based on the language specification.

For example a Select with the values 1, 2

would output:

public enum ExampleEnum
{
    [Description("1")]
    1,

    [Description("2")]
    2,
}

This change would prefix them with 'E' like pocketbase-typegen does.

public enum ShiftEnum
{
    [Description("1")]
    E2,

    [Description("2")]
    E2,
}