Example #1
0
        private static void DumpClasses(DbTable[] tables)
        {
            var buffer = new StringBuilder();

            foreach (var table in tables)
            {
                var code = ObjectGenerator.GenerateCode(DbTableConverter.ToClrClass(table, tables), table.IsReadOnly);
                buffer.AppendLine(code);
            }
            File.WriteAllText(@"C:\temp\obj.cs", buffer.ToString());
        }
Example #2
0
        private static void DumpAdapters(DbTable[] tables)
        {
            var schema = new DbSchema(string.Empty, tables);
            var buffer = new StringBuilder();

            foreach (var table in tables)
            {
                //if ( table.Name != @"Brands")
                //if (table.Name != @"Articles")
                //if (table.IsReadOnly)
                //if (table.Name != @"Activities")
                //if (table.Name != @"CalendarDays")
                if (false)
                //if (table.Name != @"Visits")
                //if (table.Name == @"Visits")
                {
                    continue;
                }
                var code = AdapterGenerator.GenerateCode(DbTableConverter.ToClrClass(table, tables), table, schema) + Environment.NewLine;
                buffer.AppendLine(code);
            }
            File.WriteAllText(@"C:\temp\ada.cs", buffer.ToString());
        }