Beispiel #1
0
        public static string ToClassName(string tableName)
        {
            var words     = tableName.Split('_');
            var converter = new PascalCaseSingularConverter();
            var className = converter.Convert(words);

            return(className);
        }
        public static IWordsConverter Create(Configuration.WordsConverter wordsConverter)
        {
            IWordsConverter converter = default;

            switch (wordsConverter.Type)
            {
            case "Camel":
            {
                converter = new CamelCaseConverter(); break;
            }

            case "Pascal":
            {
                converter = new PascalCaseConverter(); break;
            }

            case "Delimiter":
            {
                converter = new DelimiterConverter(); break;
            }

            case "PascalSingular":
            {
                converter = new PascalCaseSingularConverter(); break;
            }

            case "StrikeThrough":
            {
                converter = new StrikeThroughConverter(); break;
            }

            default:
            {
                return(new NoneConverter());
            }
            }
            converter.Initialize(wordsConverter.Parameters);
            return(converter);
        }