Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Comparing changes

Choose two branches to see what's changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
base fork: enriquein/scaffolder
base: b1da5e0137
...
head fork: enriquein/scaffolder
compare: e077a3b01d
Checking mergeability… Don't worry, you can still create the pull request.
  • 9 commits
  • 23 files changed
  • 0 commit comments
  • 1 contributor
Showing with 1,349 additions and 148 deletions.
  1. +0 −92 scaffolder.Tester/EntityGeneratorTests.cs
  2. +0 −15 scaffolder.Tester/Program.cs
  3. +21 −0 scaffolder.WinApp/Program.cs
  4. +3 −3 {scaffolder.Tester → scaffolder.WinApp}/Properties/AssemblyInfo.cs
  5. +71 −0 scaffolder.WinApp/Properties/Resources.Designer.cs
  6. +117 −0 scaffolder.WinApp/Properties/Resources.resx
  7. +30 −0 scaffolder.WinApp/Properties/Settings.Designer.cs
  8. +7 −0 scaffolder.WinApp/Properties/Settings.settings
  9. +150 −0 scaffolder.WinApp/frmConnectionOptions.Designer.cs
  10. +78 −0 scaffolder.WinApp/frmConnectionOptions.cs
  11. +147 −0 scaffolder.WinApp/frmConnectionOptions.resx
  12. +102 −0 scaffolder.WinApp/frmDatabaseObjects.Designer.cs
  13. +31 −0 scaffolder.WinApp/frmDatabaseObjects.cs
  14. +120 −0 scaffolder.WinApp/frmDatabaseObjects.resx
  15. +200 −0 scaffolder.WinApp/frmScaffoldingOptions.Designer.cs
  16. +24 −0 scaffolder.WinApp/frmScaffoldingOptions.cs
  17. +159 −0 scaffolder.WinApp/frmScaffoldingOptions.resx
  18. +52 −5 scaffolder.Tester/scaffolder.Tester.csproj → scaffolder.WinApp/scaffolder.WinApp.csproj
  19. +11 −11 scaffolder.sln
  20. +13 −0 scaffolder/Providers/ISqlProvider.cs
  21. +6 −11 scaffolder/Providers/MsSqlProvider.cs
  22. +6 −11 scaffolder/Providers/PgSqlProvider.cs
  23. +1 −0  scaffolder/scaffolder.csproj
View
92 scaffolder.Tester/EntityGeneratorTests.cs
@@ -1,92 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using scaffolder.Generators;
-using scaffolder.Providers;
-
-namespace scaffolder.Tester
-{
- public static class EntityGeneratorTests
- {
- public static void Run()
- {
- Cleanup();
- TestRandomTable();
- TestMsSqlProvider();
- TestPgSqlProvider();
- }
-
- private static void TestPgSqlProvider()
- {
- var provider = new PgSqlProvider(@"Server=sexy;Port=5432;Database=test;User Id=test;Password=test;");
- var allTables = provider.GetAvailableTables();
- var tableInfo = provider.GetFullTableInfo(allTables);
-
- var conf = new Configuration();
- conf.IncludeRepositoryMethods = true;
- conf.IncludeDataAnnotations = true;
- conf.GenerateClasses = true;
- conf.GenerateControllers = true;
- conf.Namespace = "PgSqlTest";
- conf.OutputPath = @"c:\test\PgSQL";
- var gen = new CSCodeGenerator();
-
- gen.Generate(tableInfo, conf);
- }
-
- private static void Cleanup()
- {
- System.IO.Directory.Delete(@"C:\test", true);
- }
-
- public static void TestRandomTable()
- {
- var tables = new List<Table>();
- var t = new Table();
- t.Name = "TestClass";
-
- var cols = new List<Column>(10);
- for (int i = 0; i < 10; i++)
- {
- var c = new Column();
- c.Name = "Column" + i.ToString();
- c.IsNullable = (i % 3 == 0);
- c.IsPrimaryKey = (i == 0);
- c.Type = (i == 0) ? "int" : "string";
- cols.Add(c);
- }
- t.Columns = cols;
- tables.Add(t);
-
- var conf = new Configuration();
- conf.IncludeRepositoryMethods = true;
- conf.IncludeDataAnnotations = true;
- conf.GenerateClasses = true;
- conf.GenerateControllers = true;
- conf.Namespace = "RandomTable";
- conf.OutputPath = @"c:\test\Random";
-
- var gen = new CSCodeGenerator();
- gen.Generate(tables, conf);
- }
-
- public static void TestMsSqlProvider()
- {
- var provider = new MsSqlProvider(@"Data Source=.\SQLEXPRESS;Initial Catalog=MVCMUSICSTORE;Integrated Security=SSPI;");
- var allTables = provider.GetAvailableTables();
- var tableInfo = provider.GetFullTableInfo(allTables);
-
- var conf = new Configuration();
- conf.IncludeRepositoryMethods = true;
- conf.IncludeDataAnnotations = true;
- conf.GenerateClasses = true;
- conf.GenerateControllers = true;
- conf.Namespace = "MsSqlTest";
- conf.OutputPath = @"c:\test\MsSQL";
- var gen = new CSCodeGenerator();
-
- gen.Generate(tableInfo, conf);
- }
- }
-}
View
15 scaffolder.Tester/Program.cs
@@ -1,15 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-
-namespace scaffolder.Tester
-{
- class Program
- {
- static void Main(string[] args)
- {
- EntityGeneratorTests.Run();
- }
- }
-}
View
21 scaffolder.WinApp/Program.cs
@@ -0,0 +1,21 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Windows.Forms;
+
+namespace scaffolder.WinApp
+{
+ static class Program
+ {
+ /// <summary>
+ /// The main entry point for the application.
+ /// </summary>
+ [STAThread]
+ static void Main()
+ {
+ Application.EnableVisualStyles();
+ Application.SetCompatibleTextRenderingDefault(false);
+ Application.Run(new frmConnectionOptions());
+ }
+ }
+}
View
6 scaffolder.Tester/Properties/AssemblyInfo.cs → scaffolder.WinApp/Properties/AssemblyInfo.cs
@@ -5,11 +5,11 @@
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
-[assembly: AssemblyTitle("scaffolder.Tester")]
+[assembly: AssemblyTitle("scaffolder.WinApp")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
-[assembly: AssemblyProduct("scaffolder.Tester")]
+[assembly: AssemblyProduct("scaffolder.WinApp")]
[assembly: AssemblyCopyright("Copyright © 2012")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
@@ -20,7 +20,7 @@
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
-[assembly: Guid("13e85fb8-5e1c-4082-bf95-43e24967a865")]
+[assembly: Guid("999d2bcc-3908-4266-811e-034a6ef87151")]
// Version information for an assembly consists of the following four values:
//
View
71 scaffolder.WinApp/Properties/Resources.Designer.cs
@@ -0,0 +1,71 @@
+//------------------------------------------------------------------------------
+// <auto-generated>
+// This code was generated by a tool.
+// Runtime Version:4.0.30319.261
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+// </auto-generated>
+//------------------------------------------------------------------------------
+
+namespace scaffolder.WinApp.Properties
+{
+
+
+ /// <summary>
+ /// A strongly-typed resource class, for looking up localized strings, etc.
+ /// </summary>
+ // This class was auto-generated by the StronglyTypedResourceBuilder
+ // class via a tool like ResGen or Visual Studio.
+ // To add or remove a member, edit your .ResX file then rerun ResGen
+ // with the /str option, or rebuild your VS project.
+ [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+ [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
+ internal class Resources
+ {
+
+ private static global::System.Resources.ResourceManager resourceMan;
+
+ private static global::System.Globalization.CultureInfo resourceCulture;
+
+ [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
+ internal Resources()
+ {
+ }
+
+ /// <summary>
+ /// Returns the cached ResourceManager instance used by this class.
+ /// </summary>
+ [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
+ internal static global::System.Resources.ResourceManager ResourceManager
+ {
+ get
+ {
+ if ((resourceMan == null))
+ {
+ global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("scaffolder.WinApp.Properties.Resources", typeof(Resources).Assembly);
+ resourceMan = temp;
+ }
+ return resourceMan;
+ }
+ }
+
+ /// <summary>
+ /// Overrides the current thread's CurrentUICulture property for all
+ /// resource lookups using this strongly typed resource class.
+ /// </summary>
+ [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
+ internal static global::System.Globalization.CultureInfo Culture
+ {
+ get
+ {
+ return resourceCulture;
+ }
+ set
+ {
+ resourceCulture = value;
+ }
+ }
+ }
+}
View
117 scaffolder.WinApp/Properties/Resources.resx
@@ -0,0 +1,117 @@
+<?xml version="1.0" encoding="utf-8"?>
+<root>
+ <!--
+ Microsoft ResX Schema
+
+ Version 2.0
+
+ The primary goals of this format is to allow a simple XML format
+ that is mostly human readable. The generation and parsing of the
+ various data types are done through the TypeConverter classes
+ associated with the data types.
+
+ Example:
+
+ ... ado.net/XML headers & schema ...
+ <resheader name="resmimetype">text/microsoft-resx</resheader>
+ <resheader name="version">2.0</resheader>
+ <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
+ <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
+ <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
+ <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
+ <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
+ <value>[base64 mime encoded serialized .NET Framework object]</value>
+ </data>
+ <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+ <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
+ <comment>This is a comment</comment>
+ </data>
+
+ There are any number of "resheader" rows that contain simple
+ name/value pairs.
+
+ Each data row contains a name, and value. The row also contains a
+ type or mimetype. Type corresponds to a .NET class that support
+ text/value conversion through the TypeConverter architecture.
+ Classes that don't support this are serialized and stored with the
+ mimetype set.
+
+ The mimetype is used for serialized objects, and tells the
+ ResXResourceReader how to depersist the object. This is currently not
+ extensible. For a given mimetype the value must be set accordingly:
+
+ Note - application/x-microsoft.net.object.binary.base64 is the format
+ that the ResXResourceWriter will generate, however the reader can
+ read any of the formats listed below.
+
+ mimetype: application/x-microsoft.net.object.binary.base64
+ value : The object must be serialized with
+ : System.Serialization.Formatters.Binary.BinaryFormatter
+ : and then encoded with base64 encoding.
+
+ mimetype: application/x-microsoft.net.object.soap.base64
+ value : The object must be serialized with
+ : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
+ : and then encoded with base64 encoding.
+
+ mimetype: application/x-microsoft.net.object.bytearray.base64
+ value : The object must be serialized into a byte array
+ : using a System.ComponentModel.TypeConverter
+ : and then encoded with base64 encoding.
+ -->
+ <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
+ <xsd:element name="root" msdata:IsDataSet="true">
+ <xsd:complexType>
+ <xsd:choice maxOccurs="unbounded">
+ <xsd:element name="metadata">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" />
+ </xsd:sequence>
+ <xsd:attribute name="name" type="xsd:string" />
+ <xsd:attribute name="type" type="xsd:string" />
+ <xsd:attribute name="mimetype" type="xsd:string" />
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="assembly">
+ <xsd:complexType>
+ <xsd:attribute name="alias" type="xsd:string" />
+ <xsd:attribute name="name" type="xsd:string" />
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="data">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+ <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
+ </xsd:sequence>
+ <xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
+ <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
+ <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="resheader">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+ </xsd:sequence>
+ <xsd:attribute name="name" type="xsd:string" use="required" />
+ </xsd:complexType>
+ </xsd:element>
+ </xsd:choice>
+ </xsd:complexType>
+ </xsd:element>
+ </xsd:schema>
+ <resheader name="resmimetype">
+ <value>text/microsoft-resx</value>
+ </resheader>
+ <resheader name="version">
+ <value>2.0</value>
+ </resheader>
+ <resheader name="reader">
+ <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+ </resheader>
+ <resheader name="writer">
+ <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+ </resheader>
+</root>
View
30 scaffolder.WinApp/Properties/Settings.Designer.cs
@@ -0,0 +1,30 @@
+//------------------------------------------------------------------------------
+// <auto-generated>
+// This code was generated by a tool.
+// Runtime Version:4.0.30319.261
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+// </auto-generated>
+//------------------------------------------------------------------------------
+
+namespace scaffolder.WinApp.Properties
+{
+
+
+ [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
+ [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "10.0.0.0")]
+ internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase
+ {
+
+ private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
+
+ public static Settings Default
+ {
+ get
+ {
+ return defaultInstance;
+ }
+ }
+ }
+}
View
7 scaffolder.WinApp/Properties/Settings.settings
@@ -0,0 +1,7 @@
+<?xml version='1.0' encoding='utf-8'?>
+<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)">
+ <Profiles>
+ <Profile Name="(Default)" />
+ </Profiles>
+ <Settings />
+</SettingsFile>
View
150 scaffolder.WinApp/frmConnectionOptions.Designer.cs
@@ -0,0 +1,150 @@
+namespace scaffolder.WinApp
+{
+ partial class frmConnectionOptions
+ {
+ /// <summary>
+ /// Required designer variable.
+ /// </summary>
+ private System.ComponentModel.IContainer components = null;
+
+ /// <summary>
+ /// Clean up any resources being used.
+ /// </summary>
+ /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
+ protected override void Dispose(bool disposing)
+ {
+ if (disposing && (components != null))
+ {
+ components.Dispose();
+ }
+ base.Dispose(disposing);
+ }
+
+ #region Windows Form Designer generated code
+
+ /// <summary>
+ /// Required method for Designer support - do not modify
+ /// the contents of this method with the code editor.
+ /// </summary>
+ private void InitializeComponent()
+ {
+ this.label1 = new System.Windows.Forms.Label();
+ this.txtConnectionString = new System.Windows.Forms.TextBox();
+ this.label2 = new System.Windows.Forms.Label();
+ this.cbxDbEngine = new System.Windows.Forms.ComboBox();
+ this.label3 = new System.Windows.Forms.Label();
+ this.btnNext = new System.Windows.Forms.Button();
+ this.btnExit = new System.Windows.Forms.Button();
+ this.btnTestConnection = new System.Windows.Forms.Button();
+ this.SuspendLayout();
+ //
+ // label1
+ //
+ this.label1.AutoSize = true;
+ this.label1.Location = new System.Drawing.Point(12, 9);
+ this.label1.Name = "label1";
+ this.label1.Size = new System.Drawing.Size(255, 13);
+ this.label1.TabIndex = 0;
+ this.label1.Text = "Please provide the following connection details:";
+ //
+ // txtConnectionString
+ //
+ this.txtConnectionString.Location = new System.Drawing.Point(124, 39);
+ this.txtConnectionString.Name = "txtConnectionString";
+ this.txtConnectionString.Size = new System.Drawing.Size(385, 22);
+ this.txtConnectionString.TabIndex = 1;
+ //
+ // label2
+ //
+ this.label2.AutoSize = true;
+ this.label2.Location = new System.Drawing.Point(15, 42);
+ this.label2.Name = "label2";
+ this.label2.Size = new System.Drawing.Size(103, 13);
+ this.label2.TabIndex = 2;
+ this.label2.Text = "Connection string:";
+ //
+ // cbxDbEngine
+ //
+ this.cbxDbEngine.FormattingEnabled = true;
+ this.cbxDbEngine.Location = new System.Drawing.Point(124, 68);
+ this.cbxDbEngine.Name = "cbxDbEngine";
+ this.cbxDbEngine.Size = new System.Drawing.Size(143, 21);
+ this.cbxDbEngine.TabIndex = 3;
+ //
+ // label3
+ //
+ this.label3.AutoSize = true;
+ this.label3.Location = new System.Drawing.Point(15, 71);
+ this.label3.Name = "label3";
+ this.label3.Size = new System.Drawing.Size(97, 13);
+ this.label3.TabIndex = 4;
+ this.label3.Text = "Database Engine:";
+ //
+ // btnNext
+ //
+ this.btnNext.Location = new System.Drawing.Point(434, 105);
+ this.btnNext.Name = "btnNext";
+ this.btnNext.Size = new System.Drawing.Size(75, 23);
+ this.btnNext.TabIndex = 5;
+ this.btnNext.Text = "Next";
+ this.btnNext.UseVisualStyleBackColor = true;
+ this.btnNext.Click += new System.EventHandler(this.btnNext_Click);
+ //
+ // btnExit
+ //
+ this.btnExit.DialogResult = System.Windows.Forms.DialogResult.Cancel;
+ this.btnExit.Location = new System.Drawing.Point(353, 105);
+ this.btnExit.Name = "btnExit";
+ this.btnExit.Size = new System.Drawing.Size(75, 23);
+ this.btnExit.TabIndex = 6;
+ this.btnExit.Text = "Exit";
+ this.btnExit.UseVisualStyleBackColor = true;
+ //
+ // btnTestConnection
+ //
+ this.btnTestConnection.Location = new System.Drawing.Point(273, 66);
+ this.btnTestConnection.Name = "btnTestConnection";
+ this.btnTestConnection.Size = new System.Drawing.Size(124, 23);
+ this.btnTestConnection.TabIndex = 7;
+ this.btnTestConnection.Text = "Test Connection?";
+ this.btnTestConnection.UseVisualStyleBackColor = true;
+ this.btnTestConnection.Click += new System.EventHandler(this.btnTestConnection_Click);
+ //
+ // frmConnectionOptions
+ //
+ this.AcceptButton = this.btnNext;
+ this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
+ this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+ this.CancelButton = this.btnExit;
+ this.ClientSize = new System.Drawing.Size(521, 140);
+ this.Controls.Add(this.btnTestConnection);
+ this.Controls.Add(this.btnExit);
+ this.Controls.Add(this.btnNext);
+ this.Controls.Add(this.label3);
+ this.Controls.Add(this.cbxDbEngine);
+ this.Controls.Add(this.label2);
+ this.Controls.Add(this.txtConnectionString);
+ this.Controls.Add(this.label1);
+ this.Font = new System.Drawing.Font("Segoe UI", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
+ this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
+ this.MaximizeBox = false;
+ this.Name = "frmConnectionOptions";
+ this.Text = "Scaffolder | Connection Details";
+ this.ResumeLayout(false);
+ this.PerformLayout();
+
+ }
+
+ #endregion
+
+ private System.Windows.Forms.Label label1;
+ private System.Windows.Forms.TextBox txtConnectionString;
+ private System.Windows.Forms.Label label2;
+ private System.Windows.Forms.ComboBox cbxDbEngine;
+ private System.Windows.Forms.Label label3;
+ private System.Windows.Forms.Button btnNext;
+ private System.Windows.Forms.Button btnExit;
+ private System.Windows.Forms.Button btnTestConnection;
+ }
+}
+
View
78 scaffolder.WinApp/frmConnectionOptions.cs
@@ -0,0 +1,78 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Data;
+using System.Drawing;
+using System.Linq;
+using System.Text;
+using System.Windows.Forms;
+using scaffolder.Providers;
+
+namespace scaffolder.WinApp
+{
+ public partial class frmConnectionOptions : Form
+ {
+ public frmConnectionOptions()
+ {
+ InitializeComponent();
+
+ cbxDbEngine.Items.Add("SQL Server");
+ cbxDbEngine.Items.Add("PostgreSQL");
+ }
+
+ private void btnNext_Click(object sender, EventArgs e)
+ {
+ if (HasAllRequiredFields())
+ {
+ var frmdbObjects = new frmDatabaseObjects(GetDBObjects(), this);
+ frmdbObjects.Show();
+ this.Hide();
+ }
+ }
+
+ private IEnumerable<string> GetDBObjects()
+ {
+ var provider = GetChosenProvider();
+ provider.ConnectionString = txtConnectionString.Text.Trim();
+ return provider.GetAvailableTables();
+ }
+
+ private bool HasAllRequiredFields()
+ {
+ return (txtConnectionString.Text.Trim().Length > 0 &&
+ cbxDbEngine.SelectedIndex >= 0);
+ }
+
+ private void btnTestConnection_Click(object sender, EventArgs e)
+ {
+ if (!HasAllRequiredFields())
+ {
+ MessageBox.Show("I need more information about your database in order to test it.");
+ return;
+ }
+
+ var provider = GetChosenProvider();
+ provider.ConnectionString = txtConnectionString.Text.Trim();
+
+ string testResult = provider.TestConnection() ? "succeeded." : "failed :(";
+
+ MessageBox.Show("The connection test " + testResult);
+ }
+
+ private ISqlProvider GetChosenProvider()
+ {
+ if (cbxDbEngine.SelectedIndex == -1)
+ return null;
+
+ ISqlProvider provider = null;
+
+ if (cbxDbEngine.SelectedValue.ToString() == "SQL Server")
+ provider = new MsSqlProvider();
+
+ if (cbxDbEngine.SelectedValue.ToString() == "PostgreSQL")
+ provider = new PgSqlProvider();
+
+ return provider;
+ }
+ }
+}
View
147 scaffolder.WinApp/frmConnectionOptions.resx
@@ -0,0 +1,147 @@
+<?xml version="1.0" encoding="utf-8"?>
+<root>
+ <!--
+ Microsoft ResX Schema
+
+ Version 2.0
+
+ The primary goals of this format is to allow a simple XML format
+ that is mostly human readable. The generation and parsing of the
+ various data types are done through the TypeConverter classes
+ associated with the data types.
+
+ Example:
+
+ ... ado.net/XML headers & schema ...
+ <resheader name="resmimetype">text/microsoft-resx</resheader>
+ <resheader name="version">2.0</resheader>
+ <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
+ <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
+ <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
+ <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
+ <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
+ <value>[base64 mime encoded serialized .NET Framework object]</value>
+ </data>
+ <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+ <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
+ <comment>This is a comment</comment>
+ </data>
+
+ There are any number of "resheader" rows that contain simple
+ name/value pairs.
+
+ Each data row contains a name, and value. The row also contains a
+ type or mimetype. Type corresponds to a .NET class that support
+ text/value conversion through the TypeConverter architecture.
+ Classes that don't support this are serialized and stored with the
+ mimetype set.
+
+ The mimetype is used for serialized objects, and tells the
+ ResXResourceReader how to depersist the object. This is currently not
+ extensible. For a given mimetype the value must be set accordingly:
+
+ Note - application/x-microsoft.net.object.binary.base64 is the format
+ that the ResXResourceWriter will generate, however the reader can
+ read any of the formats listed below.
+
+ mimetype: application/x-microsoft.net.object.binary.base64
+ value : The object must be serialized with
+ : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
+ : and then encoded with base64 encoding.
+
+ mimetype: application/x-microsoft.net.object.soap.base64
+ value : The object must be serialized with
+ : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
+ : and then encoded with base64 encoding.
+
+ mimetype: application/x-microsoft.net.object.bytearray.base64
+ value : The object must be serialized into a byte array
+ : using a System.ComponentModel.TypeConverter
+ : and then encoded with base64 encoding.
+ -->
+ <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
+ <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
+ <xsd:element name="root" msdata:IsDataSet="true">
+ <xsd:complexType>
+ <xsd:choice maxOccurs="unbounded">
+ <xsd:element name="metadata">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" />
+ </xsd:sequence>
+ <xsd:attribute name="name" use="required" type="xsd:string" />
+ <xsd:attribute name="type" type="xsd:string" />
+ <xsd:attribute name="mimetype" type="xsd:string" />
+ <xsd:attribute ref="xml:space" />
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="assembly">
+ <xsd:complexType>
+ <xsd:attribute name="alias" type="xsd:string" />
+ <xsd:attribute name="name" type="xsd:string" />
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="data">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+ <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
+ </xsd:sequence>
+ <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
+ <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
+ <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
+ <xsd:attribute ref="xml:space" />
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="resheader">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+ </xsd:sequence>
+ <xsd:attribute name="name" type="xsd:string" use="required" />
+ </xsd:complexType>
+ </xsd:element>
+ </xsd:choice>
+ </xsd:complexType>
+ </xsd:element>
+ </xsd:schema>
+ <resheader name="resmimetype">
+ <value>text/microsoft-resx</value>
+ </resheader>
+ <resheader name="version">
+ <value>2.0</value>
+ </resheader>
+ <resheader name="reader">
+ <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+ </resheader>
+ <resheader name="writer">
+ <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+ </resheader>
+ <metadata name="label1.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+ <value>True</value>
+ </metadata>
+ <metadata name="txtConnectionString.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+ <value>True</value>
+ </metadata>
+ <metadata name="label2.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+ <value>True</value>
+ </metadata>
+ <metadata name="cbxDbEngine.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+ <value>True</value>
+ </metadata>
+ <metadata name="label3.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+ <value>True</value>
+ </metadata>
+ <metadata name="btnNext.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+ <value>True</value>
+ </metadata>
+ <metadata name="btnExit.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+ <value>True</value>
+ </metadata>
+ <metadata name="btnTestConnection.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+ <value>True</value>
+ </metadata>
+ <metadata name="$this.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+ <value>True</value>
+ </metadata>
+</root>
View
102 scaffolder.WinApp/frmDatabaseObjects.Designer.cs
@@ -0,0 +1,102 @@
+namespace scaffolder.WinApp
+{
+ partial class frmDatabaseObjects
+ {
+ /// <summary>
+ /// Required designer variable.
+ /// </summary>
+ private System.ComponentModel.IContainer components = null;
+
+ /// <summary>
+ /// Clean up any resources being used.
+ /// </summary>
+ /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
+ protected override void Dispose(bool disposing)
+ {
+ if (disposing && (components != null))
+ {
+ components.Dispose();
+ }
+ base.Dispose(disposing);
+ }
+
+ #region Windows Form Designer generated code
+
+ /// <summary>
+ /// Required method for Designer support - do not modify
+ /// the contents of this method with the code editor.
+ /// </summary>
+ private void InitializeComponent()
+ {
+ this.label1 = new System.Windows.Forms.Label();
+ this.lbxDatabaseObjects = new System.Windows.Forms.CheckedListBox();
+ this.btnNext = new System.Windows.Forms.Button();
+ this.btnBack = new System.Windows.Forms.Button();
+ this.SuspendLayout();
+ //
+ // label1
+ //
+ this.label1.AutoSize = true;
+ this.label1.Font = new System.Drawing.Font("Segoe UI", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
+ this.label1.Location = new System.Drawing.Point(13, 13);
+ this.label1.Name = "label1";
+ this.label1.Size = new System.Drawing.Size(284, 13);
+ this.label1.TabIndex = 0;
+ this.label1.Text = "Select the database objects you wish to scaffold from:";
+ //
+ // lbxDatabaseObjects
+ //
+ this.lbxDatabaseObjects.FormattingEnabled = true;
+ this.lbxDatabaseObjects.Location = new System.Drawing.Point(16, 30);
+ this.lbxDatabaseObjects.Name = "lbxDatabaseObjects";
+ this.lbxDatabaseObjects.Size = new System.Drawing.Size(632, 378);
+ this.lbxDatabaseObjects.Sorted = true;
+ this.lbxDatabaseObjects.TabIndex = 1;
+ //
+ // btnNext
+ //
+ this.btnNext.Location = new System.Drawing.Point(572, 422);
+ this.btnNext.Name = "btnNext";
+ this.btnNext.Size = new System.Drawing.Size(75, 23);
+ this.btnNext.TabIndex = 2;
+ this.btnNext.Text = "Next";
+ this.btnNext.UseVisualStyleBackColor = true;
+ //
+ // btnBack
+ //
+ this.btnBack.Location = new System.Drawing.Point(491, 422);
+ this.btnBack.Name = "btnBack";
+ this.btnBack.Size = new System.Drawing.Size(75, 23);
+ this.btnBack.TabIndex = 3;
+ this.btnBack.Text = "Back";
+ this.btnBack.UseVisualStyleBackColor = true;
+ //
+ // frmDatabaseObjects
+ //
+ this.AcceptButton = this.btnNext;
+ this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
+ this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+ this.ClientSize = new System.Drawing.Size(660, 457);
+ this.Controls.Add(this.btnBack);
+ this.Controls.Add(this.btnNext);
+ this.Controls.Add(this.lbxDatabaseObjects);
+ this.Controls.Add(this.label1);
+ this.Font = new System.Drawing.Font("Segoe UI", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
+ this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
+ this.MaximizeBox = false;
+ this.Name = "frmDatabaseObjects";
+ this.Text = "Scaffolder | Database Objects";
+ this.Load += new System.EventHandler(this.frmDatabaseObjects_Load);
+ this.ResumeLayout(false);
+ this.PerformLayout();
+
+ }
+
+ #endregion
+
+ private System.Windows.Forms.Label label1;
+ private System.Windows.Forms.CheckedListBox lbxDatabaseObjects;
+ private System.Windows.Forms.Button btnNext;
+ private System.Windows.Forms.Button btnBack;
+ }
+}
View
31 scaffolder.WinApp/frmDatabaseObjects.cs
@@ -0,0 +1,31 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Data;
+using System.Drawing;
+using System.Linq;
+using System.Text;
+using System.Windows.Forms;
+
+namespace scaffolder.WinApp
+{
+ public partial class frmDatabaseObjects : Form
+ {
+ private Form _previousForm;
+
+ public frmDatabaseObjects()
+ {
+ InitializeComponent();
+ }
+
+ public frmDatabaseObjects(IEnumerable<string> allTables, Form previousForm): this()
+ {
+ _previousForm = previousForm;
+ }
+
+ private void frmDatabaseObjects_Load(object sender, EventArgs e)
+ {
+
+ }
+ }
+}
View
120 scaffolder.WinApp/frmDatabaseObjects.resx
@@ -0,0 +1,120 @@
+<?xml version="1.0" encoding="utf-8"?>
+<root>
+ <!--
+ Microsoft ResX Schema
+
+ Version 2.0
+
+ The primary goals of this format is to allow a simple XML format
+ that is mostly human readable. The generation and parsing of the
+ various data types are done through the TypeConverter classes
+ associated with the data types.
+
+ Example:
+
+ ... ado.net/XML headers & schema ...
+ <resheader name="resmimetype">text/microsoft-resx</resheader>
+ <resheader name="version">2.0</resheader>
+ <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
+ <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
+ <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
+ <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
+ <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
+ <value>[base64 mime encoded serialized .NET Framework object]</value>
+ </data>
+ <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+ <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
+ <comment>This is a comment</comment>
+ </data>
+
+ There are any number of "resheader" rows that contain simple
+ name/value pairs.
+
+ Each data row contains a name, and value. The row also contains a
+ type or mimetype. Type corresponds to a .NET class that support
+ text/value conversion through the TypeConverter architecture.
+ Classes that don't support this are serialized and stored with the
+ mimetype set.
+
+ The mimetype is used for serialized objects, and tells the
+ ResXResourceReader how to depersist the object. This is currently not
+ extensible. For a given mimetype the value must be set accordingly:
+
+ Note - application/x-microsoft.net.object.binary.base64 is the format
+ that the ResXResourceWriter will generate, however the reader can
+ read any of the formats listed below.
+
+ mimetype: application/x-microsoft.net.object.binary.base64
+ value : The object must be serialized with
+ : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
+ : and then encoded with base64 encoding.
+
+ mimetype: application/x-microsoft.net.object.soap.base64
+ value : The object must be serialized with
+ : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
+ : and then encoded with base64 encoding.
+
+ mimetype: application/x-microsoft.net.object.bytearray.base64
+ value : The object must be serialized into a byte array
+ : using a System.ComponentModel.TypeConverter
+ : and then encoded with base64 encoding.
+ -->
+ <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
+ <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
+ <xsd:element name="root" msdata:IsDataSet="true">
+ <xsd:complexType>
+ <xsd:choice maxOccurs="unbounded">
+ <xsd:element name="metadata">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" />
+ </xsd:sequence>
+ <xsd:attribute name="name" use="required" type="xsd:string" />
+ <xsd:attribute name="type" type="xsd:string" />
+ <xsd:attribute name="mimetype" type="xsd:string" />
+ <xsd:attribute ref="xml:space" />
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="assembly">
+ <xsd:complexType>
+ <xsd:attribute name="alias" type="xsd:string" />
+ <xsd:attribute name="name" type="xsd:string" />
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="data">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+ <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
+ </xsd:sequence>
+ <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
+ <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
+ <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
+ <xsd:attribute ref="xml:space" />
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="resheader">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+ </xsd:sequence>
+ <xsd:attribute name="name" type="xsd:string" use="required" />
+ </xsd:complexType>
+ </xsd:element>
+ </xsd:choice>
+ </xsd:complexType>
+ </xsd:element>
+ </xsd:schema>
+ <resheader name="resmimetype">
+ <value>text/microsoft-resx</value>
+ </resheader>
+ <resheader name="version">
+ <value>2.0</value>
+ </resheader>
+ <resheader name="reader">
+ <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+ </resheader>
+ <resheader name="writer">
+ <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+ </resheader>
+</root>
View
200 scaffolder.WinApp/frmScaffoldingOptions.Designer.cs
@@ -0,0 +1,200 @@
+namespace scaffolder.WinApp
+{
+ partial class frmScaffoldingOptions
+ {
+ /// <summary>
+ /// Required designer variable.
+ /// </summary>
+ private System.ComponentModel.IContainer components = null;
+
+ /// <summary>
+ /// Clean up any resources being used.
+ /// </summary>
+ /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
+ protected override void Dispose(bool disposing)
+ {
+ if (disposing && (components != null))
+ {
+ components.Dispose();
+ }
+ base.Dispose(disposing);
+ }
+
+ #region Windows Form Designer generated code
+
+ /// <summary>
+ /// Required method for Designer support - do not modify
+ /// the contents of this method with the code editor.
+ /// </summary>
+ private void InitializeComponent()
+ {
+ this.label1 = new System.Windows.Forms.Label();
+ this.txtOutputPath = new System.Windows.Forms.TextBox();
+ this.btnBrowseOutput = new System.Windows.Forms.Button();
+ this.grpOptions = new System.Windows.Forms.GroupBox();
+ this.txtNamespace = new System.Windows.Forms.TextBox();
+ this.label2 = new System.Windows.Forms.Label();
+ this.chkGenerateModels = new System.Windows.Forms.CheckBox();
+ this.chkIncludeDataAnnotations = new System.Windows.Forms.CheckBox();
+ this.chkIncludeRepositoryMethods = new System.Windows.Forms.CheckBox();
+ this.chkGenerateControllers = new System.Windows.Forms.CheckBox();
+ this.btnGenerate = new System.Windows.Forms.Button();
+ this.btnBack = new System.Windows.Forms.Button();
+ this.grpOptions.SuspendLayout();
+ this.SuspendLayout();
+ //
+ // label1
+ //
+ this.label1.AutoSize = true;
+ this.label1.Location = new System.Drawing.Point(13, 13);
+ this.label1.Name = "label1";
+ this.label1.Size = new System.Drawing.Size(221, 13);
+ this.label1.TabIndex = 0;
+ this.label1.Text = "Where should I place the generated files?";
+ //
+ // txtOutputPath
+ //
+ this.txtOutputPath.Location = new System.Drawing.Point(16, 29);
+ this.txtOutputPath.Name = "txtOutputPath";
+ this.txtOutputPath.Size = new System.Drawing.Size(238, 22);
+ this.txtOutputPath.TabIndex = 1;
+ //
+ // btnBrowseOutput
+ //
+ this.btnBrowseOutput.Location = new System.Drawing.Point(261, 27);
+ this.btnBrowseOutput.Name = "btnBrowseOutput";
+ this.btnBrowseOutput.Size = new System.Drawing.Size(75, 23);
+ this.btnBrowseOutput.TabIndex = 2;
+ this.btnBrowseOutput.Text = "Browse...";
+ this.btnBrowseOutput.UseVisualStyleBackColor = true;
+ //
+ // grpOptions
+ //
+ this.grpOptions.Controls.Add(this.chkGenerateControllers);
+ this.grpOptions.Controls.Add(this.chkIncludeRepositoryMethods);
+ this.grpOptions.Controls.Add(this.chkIncludeDataAnnotations);
+ this.grpOptions.Controls.Add(this.chkGenerateModels);
+ this.grpOptions.Location = new System.Drawing.Point(16, 119);
+ this.grpOptions.Name = "grpOptions";
+ this.grpOptions.Size = new System.Drawing.Size(320, 124);
+ this.grpOptions.TabIndex = 3;
+ this.grpOptions.TabStop = false;
+ this.grpOptions.Text = "What exactly should I generate?";
+ this.grpOptions.Enter += new System.EventHandler(this.grpOptions_Enter);
+ //
+ // txtNamespace
+ //
+ this.txtNamespace.Location = new System.Drawing.Point(16, 83);
+ this.txtNamespace.Name = "txtNamespace";
+ this.txtNamespace.Size = new System.Drawing.Size(238, 22);
+ this.txtNamespace.TabIndex = 4;
+ //
+ // label2
+ //
+ this.label2.AutoSize = true;
+ this.label2.Location = new System.Drawing.Point(13, 67);
+ this.label2.Name = "label2";
+ this.label2.Size = new System.Drawing.Size(241, 13);
+ this.label2.TabIndex = 5;
+ this.label2.Text = "What should I use as the default Namespace?";
+ //
+ // chkGenerateModels
+ //
+ this.chkGenerateModels.AutoSize = true;
+ this.chkGenerateModels.Location = new System.Drawing.Point(7, 22);
+ this.chkGenerateModels.Name = "chkGenerateModels";
+ this.chkGenerateModels.Size = new System.Drawing.Size(114, 17);
+ this.chkGenerateModels.TabIndex = 0;
+ this.chkGenerateModels.Text = "Generate Models";
+ this.chkGenerateModels.UseVisualStyleBackColor = true;
+ //
+ // chkIncludeDataAnnotations
+ //
+ this.chkIncludeDataAnnotations.AutoSize = true;
+ this.chkIncludeDataAnnotations.Location = new System.Drawing.Point(23, 45);
+ this.chkIncludeDataAnnotations.Name = "chkIncludeDataAnnotations";
+ this.chkIncludeDataAnnotations.Size = new System.Drawing.Size(232, 17);
+ this.chkIncludeDataAnnotations.TabIndex = 1;
+ this.chkIncludeDataAnnotations.Text = "Include Data Annotations for properties";
+ this.chkIncludeDataAnnotations.UseVisualStyleBackColor = true;
+ //
+ // chkIncludeRepositoryMethods
+ //
+ this.chkIncludeRepositoryMethods.AutoSize = true;
+ this.chkIncludeRepositoryMethods.Location = new System.Drawing.Point(23, 70);
+ this.chkIncludeRepositoryMethods.Name = "chkIncludeRepositoryMethods";
+ this.chkIncludeRepositoryMethods.Size = new System.Drawing.Size(292, 17);
+ this.chkIncludeRepositoryMethods.TabIndex = 2;
+ this.chkIncludeRepositoryMethods.Text = "Include Repository style methods using Simple.Data";
+ this.chkIncludeRepositoryMethods.UseVisualStyleBackColor = true;
+ //
+ // chkGenerateControllers
+ //
+ this.chkGenerateControllers.AutoSize = true;
+ this.chkGenerateControllers.Location = new System.Drawing.Point(7, 93);
+ this.chkGenerateControllers.Name = "chkGenerateControllers";
+ this.chkGenerateControllers.Size = new System.Drawing.Size(264, 17);
+ this.chkGenerateControllers.TabIndex = 3;
+ this.chkGenerateControllers.Text = "Generate basic CRUD style controllers for MVC";
+ this.chkGenerateControllers.UseVisualStyleBackColor = true;
+ //
+ // btnGenerate
+ //
+ this.btnGenerate.Location = new System.Drawing.Point(261, 249);
+ this.btnGenerate.Name = "btnGenerate";
+ this.btnGenerate.Size = new System.Drawing.Size(75, 23);
+ this.btnGenerate.TabIndex = 6;
+ this.btnGenerate.Text = "Generate!";
+ this.btnGenerate.UseVisualStyleBackColor = true;
+ //
+ // btnBack
+ //
+ this.btnBack.Location = new System.Drawing.Point(180, 249);
+ this.btnBack.Name = "btnBack";
+ this.btnBack.Size = new System.Drawing.Size(75, 23);
+ this.btnBack.TabIndex = 7;
+ this.btnBack.Text = "Back";
+ this.btnBack.UseVisualStyleBackColor = true;
+ //
+ // frmScaffoldingOptions
+ //
+ this.AcceptButton = this.btnGenerate;
+ this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
+ this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+ this.ClientSize = new System.Drawing.Size(349, 278);
+ this.Controls.Add(this.btnBack);
+ this.Controls.Add(this.btnGenerate);
+ this.Controls.Add(this.label2);
+ this.Controls.Add(this.txtNamespace);
+ this.Controls.Add(this.grpOptions);
+ this.Controls.Add(this.btnBrowseOutput);
+ this.Controls.Add(this.txtOutputPath);
+ this.Controls.Add(this.label1);
+ this.Font = new System.Drawing.Font("Segoe UI", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
+ this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
+ this.MaximizeBox = false;
+ this.Name = "frmScaffoldingOptions";
+ this.Text = "Scaffolder | Scaffolding Options";
+ this.grpOptions.ResumeLayout(false);
+ this.grpOptions.PerformLayout();
+ this.ResumeLayout(false);
+ this.PerformLayout();
+
+ }
+
+ #endregion
+
+ private System.Windows.Forms.Label label1;
+ private System.Windows.Forms.TextBox txtOutputPath;
+ private System.Windows.Forms.Button btnBrowseOutput;
+ private System.Windows.Forms.GroupBox grpOptions;
+ private System.Windows.Forms.TextBox txtNamespace;
+ private System.Windows.Forms.Label label2;
+ private System.Windows.Forms.CheckBox chkIncludeRepositoryMethods;
+ private System.Windows.Forms.CheckBox chkIncludeDataAnnotations;
+ private System.Windows.Forms.CheckBox chkGenerateModels;
+ private System.Windows.Forms.CheckBox chkGenerateControllers;
+ private System.Windows.Forms.Button btnGenerate;
+ private System.Windows.Forms.Button btnBack;
+ }
+}
View
24 scaffolder.WinApp/frmScaffoldingOptions.cs
@@ -0,0 +1,24 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Data;
+using System.Drawing;
+using System.Linq;
+using System.Text;
+using System.Windows.Forms;
+
+namespace scaffolder.WinApp
+{
+ public partial class frmScaffoldingOptions : Form
+ {
+ public frmScaffoldingOptions()
+ {
+ InitializeComponent();
+ }
+
+ private void grpOptions_Enter(object sender, EventArgs e)
+ {
+
+ }
+ }
+}
View
159 scaffolder.WinApp/frmScaffoldingOptions.resx
@@ -0,0 +1,159 @@
+<?xml version="1.0" encoding="utf-8"?>
+<root>
+ <!--
+ Microsoft ResX Schema
+
+ Version 2.0
+
+ The primary goals of this format is to allow a simple XML format
+ that is mostly human readable. The generation and parsing of the
+ various data types are done through the TypeConverter classes
+ associated with the data types.
+
+ Example:
+
+ ... ado.net/XML headers & schema ...
+ <resheader name="resmimetype">text/microsoft-resx</resheader>
+ <resheader name="version">2.0</resheader>
+ <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
+ <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
+ <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
+ <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
+ <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
+ <value>[base64 mime encoded serialized .NET Framework object]</value>
+ </data>
+ <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+ <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
+ <comment>This is a comment</comment>
+ </data>
+
+ There are any number of "resheader" rows that contain simple
+ name/value pairs.
+
+ Each data row contains a name, and value. The row also contains a
+ type or mimetype. Type corresponds to a .NET class that support
+ text/value conversion through the TypeConverter architecture.
+ Classes that don't support this are serialized and stored with the
+ mimetype set.
+
+ The mimetype is used for serialized objects, and tells the
+ ResXResourceReader how to depersist the object. This is currently not
+ extensible. For a given mimetype the value must be set accordingly:
+
+ Note - application/x-microsoft.net.object.binary.base64 is the format
+ that the ResXResourceWriter will generate, however the reader can
+ read any of the formats listed below.
+
+ mimetype: application/x-microsoft.net.object.binary.base64
+ value : The object must be serialized with
+ : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
+ : and then encoded with base64 encoding.
+
+ mimetype: application/x-microsoft.net.object.soap.base64
+ value : The object must be serialized with
+ : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
+ : and then encoded with base64 encoding.
+
+ mimetype: application/x-microsoft.net.object.bytearray.base64
+ value : The object must be serialized into a byte array
+ : using a System.ComponentModel.TypeConverter
+ : and then encoded with base64 encoding.
+ -->
+ <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
+ <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
+ <xsd:element name="root" msdata:IsDataSet="true">
+ <xsd:complexType>
+ <xsd:choice maxOccurs="unbounded">
+ <xsd:element name="metadata">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" />
+ </xsd:sequence>
+ <xsd:attribute name="name" use="required" type="xsd:string" />
+ <xsd:attribute name="type" type="xsd:string" />
+ <xsd:attribute name="mimetype" type="xsd:string" />
+ <xsd:attribute ref="xml:space" />
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="assembly">
+ <xsd:complexType>
+ <xsd:attribute name="alias" type="xsd:string" />
+ <xsd:attribute name="name" type="xsd:string" />
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="data">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+ <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
+ </xsd:sequence>
+ <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
+ <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
+ <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
+ <xsd:attribute ref="xml:space" />
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="resheader">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+ </xsd:sequence>
+ <xsd:attribute name="name" type="xsd:string" use="required" />
+ </xsd:complexType>
+ </xsd:element>
+ </xsd:choice>
+ </xsd:complexType>
+ </xsd:element>
+ </xsd:schema>
+ <resheader name="resmimetype">
+ <value>text/microsoft-resx</value>
+ </resheader>
+ <resheader name="version">
+ <value>2.0</value>
+ </resheader>
+ <resheader name="reader">
+ <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+ </resheader>
+ <resheader name="writer">
+ <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+ </resheader>
+ <metadata name="label1.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+ <value>True</value>
+ </metadata>
+ <metadata name="txtOutputPath.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+ <value>True</value>
+ </metadata>
+ <metadata name="btnBrowseOutput.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+ <value>True</value>
+ </metadata>
+ <metadata name="grpOptions.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+ <value>True</value>
+ </metadata>
+ <metadata name="chkGenerateControllers.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+ <value>True</value>
+ </metadata>
+ <metadata name="chkIncludeRepositoryMethods.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+ <value>True</value>
+ </metadata>
+ <metadata name="chkIncludeDataAnnotations.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+ <value>True</value>
+ </metadata>
+ <metadata name="chkGenerateModels.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+ <value>True</value>
+ </metadata>
+ <metadata name="txtNamespace.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+ <value>True</value>
+ </metadata>
+ <metadata name="label2.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+ <value>True</value>
+ </metadata>
+ <metadata name="btnGenerate.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+ <value>True</value>
+ </metadata>
+ <metadata name="btnBack.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+ <value>True</value>
+ </metadata>
+ <metadata name="$this.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+ <value>True</value>
+ </metadata>
+</root>
View
57 scaffolder.Tester/scaffolder.Tester.csproj → scaffolder.WinApp/scaffolder.WinApp.csproj
@@ -5,11 +5,11 @@
<Platform Condition=" '$(Platform)' == '' ">x86</Platform>
<ProductVersion>8.0.30703</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
- <ProjectGuid>{EE9BAB58-DF90-43AD-A149-275CC0D38875}</ProjectGuid>
- <OutputType>Exe</OutputType>
+ <ProjectGuid>{C805991B-4FA6-472D-9586-419D539CA012}</ProjectGuid>
+ <OutputType>WinExe</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
- <RootNamespace>scaffolder.Tester</RootNamespace>
- <AssemblyName>scaffolder.Tester</AssemblyName>
+ <RootNamespace>scaffolder.WinApp</RootNamespace>
+ <AssemblyName>scaffolder</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<TargetFrameworkProfile>Client</TargetFrameworkProfile>
<FileAlignment>512</FileAlignment>
@@ -40,12 +40,59 @@
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
+ <Reference Include="System.Deployment" />
+ <Reference Include="System.Drawing" />
+ <Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
- <Compile Include="EntityGeneratorTests.cs" />
+ <Compile Include="frmConnectionOptions.cs">
+ <SubType>Form</SubType>
+ </Compile>
+ <Compile Include="frmConnectionOptions.Designer.cs">
+ <DependentUpon>frmConnectionOptions.cs</DependentUpon>
+ </Compile>
+ <Compile Include="frmDatabaseObjects.cs">
+ <SubType>Form</SubType>
+ </Compile>
+ <Compile Include="frmDatabaseObjects.Designer.cs">
+ <DependentUpon>frmDatabaseObjects.cs</DependentUpon>
+ </Compile>
+ <Compile Include="frmScaffoldingOptions.cs">
+ <SubType>Form</SubType>
+ </Compile>
+ <Compile Include="frmScaffoldingOptions.Designer.cs">
+ <DependentUpon>frmScaffoldingOptions.cs</DependentUpon>
+ </Compile>
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
+ <EmbeddedResource Include="frmConnectionOptions.resx">
+ <DependentUpon>frmConnectionOptions.cs</DependentUpon>
+ </EmbeddedResource>
+ <EmbeddedResource Include="frmDatabaseObjects.resx">
+ <DependentUpon>frmDatabaseObjects.cs</DependentUpon>
+ </EmbeddedResource>
+ <EmbeddedResource Include="frmScaffoldingOptions.resx">
+ <DependentUpon>frmScaffoldingOptions.cs</DependentUpon>
+ </EmbeddedResource>
+ <EmbeddedResource Include="Properties\Resources.resx">
+ <Generator>ResXFileCodeGenerator</Generator>
+ <LastGenOutput>Resources.Designer.cs</LastGenOutput>
+ <SubType>Designer</SubType>
+ </EmbeddedResource>
+ <Compile Include="Properties\Resources.Designer.cs">
+ <AutoGen>True</AutoGen>
+ <DependentUpon>Resources.resx</DependentUpon>
+ </Compile>
+ <None Include="Properties\Settings.settings">
+ <Generator>SettingsSingleFileGenerator</Generator>
+ <LastGenOutput>Settings.Designer.cs</LastGenOutput>
+ </None>
+ <Compile Include="Properties\Settings.Designer.cs">
+ <AutoGen>True</AutoGen>
+ <DependentUpon>Settings.settings</DependentUpon>
+ <DesignTimeSharedInput>True</DesignTimeSharedInput>
+ </Compile>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\scaffolder\scaffolder.csproj">
View
22 scaffolder.sln
@@ -3,7 +3,7 @@ Microsoft Visual Studio Solution File, Format Version 11.00
# Visual Studio 2010
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "scaffolder", "scaffolder\scaffolder.csproj", "{DD4FC234-05BB-4331-A8B5-239D10FF9548}"
EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "scaffolder.Tester", "scaffolder.Tester\scaffolder.Tester.csproj", "{EE9BAB58-DF90-43AD-A149-275CC0D38875}"
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "scaffolder.WinApp", "scaffolder.WinApp\scaffolder.WinApp.csproj", "{C805991B-4FA6-472D-9586-419D539CA012}"
ProjectSection(ProjectDependencies) = postProject
{DD4FC234-05BB-4331-A8B5-239D10FF9548} = {DD4FC234-05BB-4331-A8B5-239D10FF9548}
EndProjectSection
@@ -28,16 +28,16 @@ Global
{DD4FC234-05BB-4331-A8B5-239D10FF9548}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
{DD4FC234-05BB-4331-A8B5-239D10FF9548}.Release|Mixed Platforms.Build.0 = Release|Any CPU
{DD4FC234-05BB-4331-A8B5-239D10FF9548}.Release|x86.ActiveCfg = Release|Any CPU
- {EE9BAB58-DF90-43AD-A149-275CC0D38875}.Debug|Any CPU.ActiveCfg = Debug|x86
- {EE9BAB58-DF90-43AD-A149-275CC0D38875}.Debug|Mixed Platforms.ActiveCfg = Debug|x86
- {EE9BAB58-DF90-43AD-A149-275CC0D38875}.Debug|Mixed Platforms.Build.0 = Debug|x86
- {EE9BAB58-DF90-43AD-A149-275CC0D38875}.Debug|x86.ActiveCfg = Debug|x86
- {EE9BAB58-DF90-43AD-A149-275CC0D38875}.Debug|x86.Build.0 = Debug|x86
- {EE9BAB58-DF90-43AD-A149-275CC0D38875}.Release|Any CPU.ActiveCfg = Release|x86
- {EE9BAB58-DF90-43AD-A149-275CC0D38875}.Release|Mixed Platforms.ActiveCfg = Release|x86
- {EE9BAB58-DF90-43AD-A149-275CC0D38875}.Release|Mixed Platforms.Build.0 = Release|x86
- {EE9BAB58-DF90-43AD-A149-275CC0D38875}.Release|x86.ActiveCfg = Release|x86
- {EE9BAB58-DF90-43AD-A149-275CC0D38875}.Release|x86.Build.0 = Release|x86
+ {C805991B-4FA6-472D-9586-419D539CA012}.Debug|Any CPU.ActiveCfg = Debug|x86
+ {C805991B-4FA6-472D-9586-419D539CA012}.Debug|Mixed Platforms.ActiveCfg = Debug|x86
+ {C805991B-4FA6-472D-9586-419D539CA012}.Debug|Mixed Platforms.Build.0 = Debug|x86
+ {C805991B-4FA6-472D-9586-419D539CA012}.Debug|x86.ActiveCfg = Debug|x86
+ {C805991B-4FA6-472D-9586-419D539CA012}.Debug|x86.Build.0 = Debug|x86
+ {C805991B-4FA6-472D-9586-419D539CA012}.Release|Any CPU.ActiveCfg = Release|x86
+ {C805991B-4FA6-472D-9586-419D539CA012}.Release|Mixed Platforms.ActiveCfg = Release|x86
+ {C805991B-4FA6-472D-9586-419D539CA012}.Release|Mixed Platforms.Build.0 = Release|x86
+ {C805991B-4FA6-472D-9586-419D539CA012}.Release|x86.ActiveCfg = Release|x86
+ {C805991B-4FA6-472D-9586-419D539CA012}.Release|x86.Build.0 = Release|x86
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
View
13 scaffolder/Providers/ISqlProvider.cs
@@ -0,0 +1,13 @@
+using System;
+using System.Collections.Generic;
+
+namespace scaffolder.Providers
+{
+ public interface ISqlProvider
+ {
+ string ConnectionString { get; set; }
+ IEnumerable<string> GetAvailableTables();
+ List<Table> GetFullTableInfo(IEnumerable<string> tableList);
+ bool TestConnection();
+ }
+}
View
17 scaffolder/Providers/MsSqlProvider.cs
@@ -8,16 +8,11 @@
namespace scaffolder.Providers
{
- public class MsSqlProvider
+ public class MsSqlProvider : ISqlProvider
{
- private string _connectionString;
+ public string ConnectionString { get; set; }
- private MsSqlProvider () {}
-
- public MsSqlProvider(string connectionString)
- {
- _connectionString = connectionString;
- }
+ public MsSqlProvider () {}
/// <summary>
/// Test connection to the database using the connection string provided in the class constructor.
@@ -25,7 +20,7 @@ public MsSqlProvider(string connectionString)
/// <returns>True if successful, false otherwise.</returns>
public bool TestConnection()
{
- SqlConnection conn = new SqlConnection(_connectionString);
+ SqlConnection conn = new SqlConnection(ConnectionString);
try
{
conn.Open();
@@ -48,7 +43,7 @@ public IEnumerable<string> GetAvailableTables()
if (!TestConnection())
throw new InvalidOperationException("Failed to connect to the database.");
- using(SqlConnection conn = new SqlConnection(_connectionString))
+ using(SqlConnection conn = new SqlConnection(ConnectionString))
{
string query = "select table_schema + '.' + table_name from information_schema.tables order by table_schema, table_name";
conn.Open();
@@ -65,7 +60,7 @@ public List<Table> GetFullTableInfo(IEnumerable<string> tableList)
{
var tables = new List<Table>(tableList.Count());
- using (SqlConnection conn = new SqlConnection(_connectionString))
+ using (SqlConnection conn = new SqlConnection(ConnectionString))
{
string query = @" select
cols.column_name as Name,
View
17 scaffolder/Providers/PgSqlProvider.cs
@@ -7,16 +7,11 @@
namespace scaffolder.Providers
{
- public class PgSqlProvider
+ public class PgSqlProvider : ISqlProvider
{
- private string _connectionString;
+ public string ConnectionString { get; set; }
- private PgSqlProvider() {}
-
- public PgSqlProvider(string connectionString)
- {
- _connectionString = connectionString;
- }
+ public PgSqlProvider() {}
/// <summary>
/// Test connection to the database using the connection string provided in the class constructor.
@@ -24,7 +19,7 @@ public PgSqlProvider(string connectionString)
/// <returns>True if successful, false otherwise.</returns>
public bool TestConnection()
{
- var conn = new NpgsqlConnection(_connectionString);
+ var conn = new NpgsqlConnection(ConnectionString);
try
{
conn.Open();
@@ -47,7 +42,7 @@ public IEnumerable<string> GetAvailableTables()
if (!TestConnection())
throw new InvalidOperationException("Failed to connect to the database.");
- using (var conn = new NpgsqlConnection(_connectionString))
+ using (var conn = new NpgsqlConnection(ConnectionString))
{
string query = "select table_schema || '.' || table_name from information_schema.tables where table_schema = 'public' order by table_schema, table_name";
conn.Open();
@@ -88,7 +83,7 @@ order by
var tables = new List<Table>(tableList.Count());
- using (var conn = new NpgsqlConnection(_connectionString))
+ using (var conn = new NpgsqlConnection(ConnectionString))
{
conn.Open();
View
1  scaffolder/scaffolder.csproj
@@ -57,6 +57,7 @@
<Compile Include="Column.cs" />
<Compile Include="Helpers\FileWriter.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
+ <Compile Include="Providers\ISqlProvider.cs" />
<Compile Include="Providers\MsSqlProvider.cs" />
<Compile Include="Providers\PgSqlProvider.cs" />
<Compile Include="Table.cs" />

No commit comments for this range

Something went wrong with that request. Please try again.