-
Notifications
You must be signed in to change notification settings - Fork 224
Closed
Labels
Description
I am trying to add a const string with the field name of each field to allow the use of strongly typed field names instead of magic strings. Our previous ORM created these automatically and they are very useful. For example:
public bool IsAllowed {get; set; }
public const string IsAllowedField = "IsAllowed";To achieve this here I tried adding the following to the ttinclude file
public {{#if OverrideModifier}}override {{/if}}{{WrapIfNullable}} {{NameHumanCase}} { get; {{PrivateSetterForComputedColumns}}set; }{{PropertyInitialisers}}{{InlineComments}}{{#newline}}
public const string {{NameHumanCase}}Field = "{{NameHumanCase}}"; {{#newline}}
The problem I have is the double quotes around the fieldname in the second line. (The first line is shown to show location only)
I have tried """, I have tried /", I have tried '/"', and after dozens of hours of searching, and trial and error, I am unable to find the correct way to do this. Can you please help.
The addition of this line might also be helpful for others to avoid the use of magic strings.
Thanks for any advise you can give,
Reactions are currently unavailable