Project Description
This application is aimed to generate .NET class and methods for databases and model them based on customizable patterns.

SalarDbCodeGenerator is a database first, code generator. It uses customizable patterns to generate different codes and models for applications. The generator engine is mostly optimized for C# but it can be used to generate any other programming language code.

New Requests

Is there anything you want to be supported? Get over here.

Supported Databases

  • Micorsoft SQL Server (2000/.../2014)
    (Supports columns description)
  • SQL Server Compact Edition 4
  • Oracle Database (8i/9i/10g/11g)
  • SQLite (v3 and above)

Features

  • Customizable patterns
  • Tables foreign key relations
  • Tables constraint keys
  • Columns description
  • Ignored prefixes / Ignored suffixes
  • Prefix for tables / Suffix for tables
  • Prefix for views / Suffix for views
  • Renaming Options (Remove underline / Case Change / Underline is word delimiter)
  • Default Namespace
  • Ability to generate code for any programming language

Patterns List (Installed by default)

  • Entity Framework Code First
  • NHibernate Mapping By Code
  • NHibernate Castle ActiveRecord
  • LinqToSql
  • Entity Framework 4 POCO
  • Dapper
  • Dapper+SQLinq
  • 3Tier

About Patterns

Entity Framework Code First

  • EF4 CodeFirst
    (with data annotations)
  • EF4 CodeFirst MVVM
  • (with data annotations and property change notifications)
  • EF4 CodeFirst Simple
    (plain simple classes)

Generates database model for Entity Framework 4.2 Code First along side the ORM base classes. These patterns also come with additional methods and helpers which are useful for CodeFirst programming.

Data annotations and change notifications are separated in different patterns. All generated models are customizable through partial classes.

  • Renaming options are supported
  • Multiply database model in app is supported (No same table name)
  • Many to many relation is not supported by default

NHibernate Mapping By Code 

  • NH Mapping By Code
    (with data annotations)
  • NH Mapping By Code MVVM
  • (with data annotations and property change notifications)
  • NH Mapping By Code Simple
    (plain simple classes)

Generates database models for NHibernate 3.2 Mapping by Code along side the ORM base classes. These pattern also come with a default session manager and customizable object mapper for mapping by code.

Data annotations and change notifications are separated in different patterns. All generated models are customizable through partial classes.

  • Renaming options are supported
  • Multiply database model in app is supported
  • Many to many relation is not supported by default

NHibernate ActiveRecord

  • NHibernate ActiveRecord
  • NHibernate ActiveRecord WCF

Generates database models which can be used with Castle ActiveRecord 2.2 or 3. This pattern also comes with additional methods and helpers which are essential for Castle ActiveRecord programming.

The "NHibernate ActiveRecord WCF" pattern generates non-standard/unused table IDs, which are useful only when transferring classes through WCF. Of course these IDs should be filled manually.

  • Renaming options are supported
  • Multiply database model in app is supported (No same table name)

LinqToSql C#

Generates database models for LinqToSql in 3Tier model (Only two layer is generated including Business and DAL). CRUD operations and custom method call should be used like 3Tier method.

Sample usage:

using (var bll = new UsersBLL())
{
    return bll.GetAll().OrderBy(x => x.UserName);
}

  • Renaming options are NOT supported
  • Multiply database model in app is NOT supported

Entity Framework 4 POCO

  • EF4 POCO C#
  • EF4 POCO LINQ C#

Generates database POCO models for Entity Framework 4. The "EF4 POCO LINQ" pattern also generates 3Tier method additional classes which both are usable.

These two pattern can not work without model file in application. The model file name should be same as database name (e.g. TestDbEntities.edmx and TestDbEntities class name).

When creating the model "Pluralize or singularize generated object names" should be unchecked. Afterward in model designer the "Code Generation Strategy" property should be changed to "None". These two steps are required to get the POCO classes work fine.

  • Renaming options are NOT supported
  • Multiply database model in app is supported
  • Many to Many is NOT supported

DapperAccess

  • DapperAccess
  • DapperContext
  • Dapper+SQLinq

Generates database model and entity access wrapper for Dapper mini ORM. Dapper basically is a simple object mapper which maps query results to entity objects. It has one big benefit, Performance. To see the differences read the performance benchmarks in the Dapper page.

This pattern generates Dapper Access wrapper which includes connection management and default CRUD operations. As usual some query methods are generated too. Generated model classes are not necessary for this pattern so other ORMs generated entity models can be used.

Dapper+SQLinq is also another pattern based on DapperAccess pattern which uses SQLinq to generate queries. It only works correctly with sql server.

  • Renaming options are NOT supported
  • Multiply database model in app can be used (with some considerations)
  • Many to Many is NOT supported
  • One to One is NOT supported

3Tier

  • 3Tier C#
  • 3Tier VB.NET

Generates database models for classic 3Tier applications. Uses base ADO.Net classes to apply the operations. These patterns uses Stored procedures to do the operations. For all tables and views default CRUD operations are created.

These patterns are optimized for speed, in a case that application requires low latency access to large amount of data. C# pattern uses additional column order caching while reading data, which gains extra optimization in large bunch of records.

The bad part of these patterns is every new query should be done manually.

Sample usage:

using (var bll = new UsersBLL())
{
    return bll.GetByUserId(10);
}

  • Renaming options are NOT supported
  • Multiply database model in app is NOT supported
  • binary and ntext columns in one table together is not supported.
  • SQL Server only.
  • LINQ is not supported.

 

  • Main Window

  • Project Options

EF4 POCO LIN

Last edited Jul 19 at 3:55 PM by salar2k, version 20