Ejemplo n.º 1
0
        public void GenerateFiles(ISchemaInfoProvider provider, string @namespace, string directory, IEnumerable <string> nonPersistedColumns)
        {
            var fileName = "PlantERD.txt";
            var path     = Path.Combine(directory, fileName);

            var sb = new StringBuilder();

            sb.AppendLine("@startuml");

            foreach (var tbl in provider.Tables)
            {
                sb.AppendLine(GenerateEntity(tbl));
            }

            foreach (var tbl in provider.Tables)
            {
                sb.AppendLine();
                foreach (var fk in tbl.ForeignKeys)
                {
                    sb.AppendLine($"{tbl.TableName} }}o--o| {fk.Table}");
                }
            }

            sb.AppendLine("@enduml");

            File.WriteAllText(path, sb.ToString());
        }
 public void GenerateFiles(ISchemaInfoProvider provider, string @namespace, string directory, IEnumerable <string> nonPersistedColumns)
 {
     foreach (var tableInfo in provider.Tables)
     {
         GenerateFile(tableInfo, @namespace, directory, nonPersistedColumns);
     }
 }
Ejemplo n.º 3
0
        public void GenerateFiles(ISchemaInfoProvider provider, string @namespace, string directory, IEnumerable <string> nonPersistedColumns)
        {
            var tabIndex = 0;
            var fileName = "Mermaid.txt";
            var path     = Path.Combine(directory, fileName);

            var sb = new StringBuilder();

            sb.AppendLine("classDiagram");
            tabIndex++;

            foreach (var tbl in provider.Tables)
            {
                sb.AppendLine(GenerateEntity(tbl, tabIndex));
            }

            foreach (var tbl in provider.Tables)
            {
                sb.AppendLine();
                foreach (var fk in tbl.ForeignKeys)
                {
                    sb.TabAppendLine($"{fk.Table} <|-- {tbl.TableName}", tabIndex);
                }
            }

            File.WriteAllText(path, sb.ToString());
        }
Ejemplo n.º 4
0
 private KeyValueSchema(ISchema <K> KeySchema, ISchema <V> ValueSchema, KeyValueEncodingType KeyValueEncodingType)
 {
     _keySchema            = KeySchema;
     _valueSchema          = ValueSchema;
     _keyValueEncodingType = KeyValueEncodingType;
     _schemaInfoProvider   = new InfoSchemaInfoProvider(this);
     // if either key schema or value schema requires fetching schema info,
     // we don't need to configure the key/value schema info right now.
     // defer configuring the key/value schema info until `configureSchemaInfo` is called.
     if (!RequireFetchingSchemaInfo())
     {
         ConfigureKeyValueSchemaInfo();
     }
 }