My favorites | Sign in
Project Home Wiki Source
Project Information
Members
Featured
Wiki pages



Welcome

The ".NET Object Relational Mapper" Project is a simple object relational mapping tool for Microsoft .NET Web Applications. This tool automatically generates object classes and database stored procedures for CRUD operations by evaluating a target database.

The Object Relational Mapper (ORM) tool is recommended to be used as an external tool within Microsoft Visual Studio.





What It Does

The ORM tool generates classes and stored procedures based on user-tables found within a database. Specifically, the ORM tool creates the following:

  1. SQL Helper Class containing methods to execute database operations.
  2. Base Class containing shared methods used by other generated classes.
  3. Generated Classes based on the tables contained within a target database.
  4. Generated Stored Procedures that perform CRUD operations.

It is important to note that the Generated Classes are partial classes and derived from the Base Class. Therefore, you may extended the Generated Classes for specific tasks without modifying the generated code.





How It Works

When the ORM tool is invoked, it does the following:

  1. Reads the project's web.config file for the target database information and other directives.
  2. Evaluates the user-tables in the target database.
  3. Evaluates the columns within the user-tables in the target database.
  4. Creates the /Models folder within the project.
  5. Creates the Base and SQL Helper classes and places them in the /Models/Generated/Helper folder.
  6. Creates the Generated Stored Procedures from the evaluated user-tables and places them in the /Models/Generated/Sql folder.
  7. Creates the Generated Classes from the evaluated user-tables and places them in the /Models/Generated folder.



Project Configuration

At a minimum, the following code must be present in a project's web.config file:

<configuration>

	<configSections>
		<section
			name="MappingConfiguration"
			requirePermission="false"
			type="ObjectRelationalMapping.Configuration.MappingSection, ObjectRelationalMapping" />
	</configSections>

	<MappingConfiguration
		ApplicationNamespace="MyProjectNamespace"
		DatabaseConnectionString="Data Source=MyDatabaseServer; Database=MyDatabase; Integrated Security=true;" />

</configuration>



External Tool Configuration

The ORM tool is recommended to be used as an external tool within Microsoft Visual Studio. Use the following directions to add the tool as an external tool within Microsoft Visual Studio:

  1. Click on Tools, External Tools....
  2. Click on Add.
  3. Enter "Object Relational Mapper" in the Title field.
  4. Select the ExternalTool.exe file in the Command field.
  5. Enter $(ProjectDir) in the Arguments field.
  6. De-select the Close on exit check-box.
  7. Select the Use Output window check-box.

Powered by Google Project Hosting