1
Vote

Same as database column name casing broken by pascal/Camelcase fix

description

Commit ec580a8e74b4d8522345182f0dca46c2a6d480d7 causes Original case to have property names with underscores in between words.

Recommend move the code to the pascal- and camel-case formatters like so, since they are specific to these usages:
    public class CamelCaseTextFormatter : AbstractTextFormatter
    {
        public override string FormatText(string text)
        {
            // Split by capitals to preserve pascal/camelcasing in original text value
            // Preserves TLAs. See http://stackoverflow.com/a/1098039
            text = Regex.Replace(text, "((?<=[a-z])[A-Z]|[A-Z](?=[a-z]))", " $1").Trim();

            return base.FormatText(text).ToCamelCase();
        }
    }

    public class PascalCaseTextFormatter : AbstractTextFormatter
    {
        public override string FormatText(string text)
        {
            // Split by capitals to preserve pascal/camelcasing in original text value
            // Preserves TLAs. See http://stackoverflow.com/a/1098039
            text = Regex.Replace(text, "((?<=[a-z])[A-Z]|[A-Z](?=[a-z]))", " $1").Trim();

            return base.FormatText(text).ToPascalCase();
        }
    }

comments