Skip to content
This repository was archived by the owner on Sep 21, 2022. It is now read-only.

ellerbus/Dynamo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

159 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Dynamo

Dynamo is a friendly generator that uses DB Schema Reader and DotLiquid Syntax to generate code files.

Quick Start

For those that simply what to jump in and check things out download and view the Sample Solution. For a more in depth sample there's NerdBudget. NerdBudget is a simple application for tracking a budget, but is a completely implemented system whereby output from a template was modified based on the need of the application. Whereas the Sample Solution focuses on a straight out-of-the-box implementation of non-modified templates. For all intents and purposes, NerdBudget is maintained and more up-to-date compared with the Sample Solution.

Helpful Pages

SQL Databases Currently Supported

via DB Schema Reader

  • SqlServer
  • SqlServer CE 4
  • MySQL
  • SQLite
  • ODP
  • Devar
  • PostgreSql
  • Db2
  • System.Data.OracleClient

Template Sample (SQL Schema, Template, & Final Code File)

CREATE TABLE MEMBER
(
	member_id		int not null,
	member_name		varchar(50) not null,
	primary key		(member_id),
	unique			(member_name)
)
{% capture BASECLASS %}{{ table.name | pascal }}{% endcapture -%}
{% capture PROJECT %}{{ SOLUTION }}.WebProject{% endcapture -%}
{% capture FILENAME %}{{ PROJECT }}\Models\Generated\{{ BASECLASS }}.cs{% endcapture -%}
using System;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;

namespace {{ PROJECT }}.Models
{
	///	<summary>
	///	</summary>
	[Table("{{ table.name }}")]
	public partial class {{ BASECLASS }}
	{
		#region Primary Key Properties
		{% for column in table.primary_keys %}
		///	<summary>
		///	Gets / Sets database column '{{ column.name }}' (primary key)
		///	</summary>
		[Column("{{ column.name }}"), Key]
		public {{ column.clr_type }} {{ column.name | pascal | remove:BASECLASS }} { get; set; }
		
		{% endfor -%}
		
		#endregion
		
		#region Properties
		{% for column in table.columns %}{% if column.is_primary_key == false %}
		///	<summary>
		///	Gets / Sets database column '{{ column.name }}'
		///	</summary>
		[Column("{{ column.name }}")]
		public {{ column.clr_type }} {{ column.name | pascal }} { get; set; }

		{% endif %}{% endfor -%}

		#endregion
	}
}
using System;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;

namespace MySolution.WebProject.Models
{
	///	<summary>
	///	</summary>
	[Table("MEMBER")]
	public partial class Member
	{
		#region Primary Key Properties
		
		///	<summary>
		///	Gets / Sets database column 'member_id' (primary key)
		///	</summary>
		[Column("member_id"), Key]
		public int Id { get; set; }
		
		#endregion
		
		#region Properties
		
		///	<summary>
		///	Gets / Sets database column 'member_name'
		///	</summary>
		[Column("member_name")]
		public string MemberName { get; set; }  // notice we didn't use remove:BASECLASS here

		#endregion
	}
}

Screen Shots

Code Generator

Code Generator

Connection String Builder

Connection String Builder

About

Easy / Dynamic Liquid Code Generator

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors