Пример #1
0
        public override string RenderEnumFor(TableMetaData table, ColumnMetaData column)
        {
            var match   = _regex.Match(column.Comment);
            var comment = Replace(match.Value);
            var temp    = Regex.Replace(table.Name, @"\d", string.Empty).Replace("_", string.Empty);

            _enum_name = $"{temp}_{column.Name}_Enum";

            var enum_info = new EnumInfo
            {
                EnumName = _enum_name,
                Comment  = comment,
                Values   = comment.Split(new char[] { ' ' }, StringSplitOptions.RemoveEmptyEntries),
                DbType   = column.DbType
            };
            var model = new ViewInfoWapper(this);

            model.Config    = _config;
            model.TableInfo = table;
            model.EnumInfo  = enum_info;

            return(Render("Enum/enum.cshtml", model));
        }
Пример #2
0
 public abstract bool CanGenerateEnum(TableMetaData table, ColumnMetaData column);
Пример #3
0
 public abstract string RenderEnumFor(TableMetaData table, ColumnMetaData column);
Пример #4
0
 public abstract string RenderModelFor(TableMetaData table);