Skip to content
This repository has been archived by the owner on Oct 12, 2021. It is now read-only.
/ wpf-lite-poco-gen Public archive

Wpf MVVM UI and Console App to generate poco for .NET C# lite orm's

Notifications You must be signed in to change notification settings

mattkol/wpf-lite-poco-gen

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

WPF Lite Poco Generator

This is a lite Poco generation tool that uses t4 template. It is "lite" because it is meant to support lite .NET ORM's like Dapper, PetaPoco, OrmLite. It is designed to create models for the Dapper.SimpleCRUD project but can be easily modified for other lite ORM's. The solution extends the template provided by Dapper.SimpleCRUD for MsSql, and PetaPoco, OrmLite t4 templates for MySql and PostgreSql. I added implementation for Sqlite.

While Dapper.SimpleCRUD, PetaPoco, and OrmLite uses build time t4 processing, the solution uses runtime t4 processing - https://msdn.microsoft.com/en-us/library/ee844259.aspx

The solution supports MsSql, Sqlite, MySql and PostgreSql

There are 2 approaches - a WPF MVVM UI and a Console App. There are sample executable files in the Executables folder.

WPF MVVM UI

The UI uses Mahapps.Metro WPF framework.

Console App

The console app has the following usages:

Usage:
poco_gen_console
         -dbtype:database type [mssql, sqlite, mysql, postgres]
         -conn_string:full connection string value
         -include_relationships:true|false [Optional]
         -namespace:namespace [Optional - deafult is database type + .Model]
         -models_location:full folder path for model [Optional - default is current location with database type + .Model subdirectory name]

or

poco_gen_console
         -dbtype:database type [mssql, sqlite, mysql, postgres]
         -conn_string_name:connection string name in app.config
         -include_relationships:true|false [Optional]
         -namespace:namespace [Optional - deafult is database type + .Model]
         -models_location:full folder path for model [Optional - default is current location with database type + .Model subdirectory name]

Sample usages:

poco_gen_console  -dbtype:postgres -conn_string_name:PostgreSqlConnectionString
poco_gen_console  -dbtype:mysql -conn_string_name:MySqlConnectionString -include_relationships:false
poco_gen_console  -dbtype:sqlite -conn_string_name:SqliteConnectionString
poco_gen_console  -dbtype:mssql -conn_string_name:MsSqlConnectionString -namespace:Chinook.Models
poco_gen_console  -dbtype:mssql -conn_string:"Data Source=localhost; Initial Catalog=Chinook;Integrated Security=SSPI" 

References

Releases

No releases published

Packages

No packages published