About it:

This project introduce the concept or O-R Mappings Tools.

Besides it is an small version of current O-R Mapping tools it really easy to use, and quicly to learn.

By Attributes and Generic in .NET 2.0 The Engine DAL reduce the Data Access Layer to one call.

This code is written in C# 2.0 and is based on Microsoft Enterprise Library June 2006 for .NET framework 2.0.

Define an Entity Business Like Client, Order, Invoice, etc. and next decorate it with attibutes from this framework, like the example below:

using Comunidad.Sistema;
using Microsoft.Practices.EnterpriseLibrary.Data;

 [ConnectionStringName("NORTHWIND"), ReadMethodName("OrderRead")]
public class Orden 
{ 
        private int? numeroOrden;
        [ColumnName("OrderID"), ParameterName("@OrderID", IsPrimaryKey  true, IsForCreate  false)]
        public int? NumeroOrden
        {
            get { return numeroOrden; }
            set { numeroOrden = value; }
        }
        private DateTime fecha;

        [ColumnName("OrderDate"), ParameterName("@OrderDate")]
        public DateTime Fecha
        {
            get { return fecha; }
            set { fecha = value; }
        }

       //.. and so on 

    }


After that you just have to invoke the engine in on line of code, like this:

         DataSet ds = EngineDAL<Orden>.ListarDS(new Orden());



The main attributes are:
  • ConnectionStringName("name of connection in web.config")
  • ReadMethodName("Store Procedure to get a list")
  • Columnname("NameofColumnInSQLDataBase")

Namespace to call:
  • Comunidad.Sistema
  • Microsoft.Practices.EnterpriseLibrary.Data

More Info and Examples:

url to introduce this tool in my blog http://jmhogua.blogspot.com/search?qinteligentes *

An introduction of Data Access Layer http://jmhogua.blogspot.com/2007/01/programacin-en-capas-primera-parte-capa.html *
  • Only in spanish language.

Current Release Version (Includes code) http://www.codeplex.com/EngineDAL/Release/ProjectReleases.aspx?ReleaseId=14960

Last edited Jul 25, 2008 at 12:24 AM by jmho, version 11