Quick Start

Generate files (by Sogen generator console application)

  1. Download Sogen console application
  2. run SogenGenerator
  3. type "y" to create template config file.
  4. Open "SogenBLToolkitconfig.xml" file and edit that
    1. Set root namespace in <rootNamespace>
    2. Set data model name postfix in <dataModelNamePostfix>
    3. Set export path in <exportPath>
    4. Set Sql Connection in <MSSqlConfig>
    5. create <schema>schema name</schema> for each schema that you want generate code.
  5. Run SogenGenerator
note: for more information see configuration page.

Create class library

  1. Create a new class library
  2. Add bltoolkit dll to project references (including in download pack & available to download from BLToolkit)
  3. Add System.Configuration to project references
  4. copy & paste generated files in project
  5. Build project

Use generated classes

Sogen generate a class for each table or view in your database. this classes are in namespaces with name of schemas.
you can direct use this class and helper methods for insert/update/delete/get.also you can use datamodel of each schema.
Download sample project from download page & Bltoolkit documentation for more info

note: create connection strings in your app.config or web.config for each schema. base on generated config.cs file.
for more information see Sogen Documentation

Last edited Sep 17, 2010 at 5:59 PM by soroushayoubi, version 3

Comments

jpolvora Jul 27, 2011 at 8:09 PM 
Nice project. I will fork it and customize it.
I have a Db with a thousand tables, but I don't want to generate code for all of them.
Would be nice if a could chosse tables I want to generate code. The idea is place the table list in the config files

<tables>table1,table2,table3</tables>