Project Description
The easy way for mapping of entities in sql.

example:

<?xml version="1.0" encoding="utf-8" ?>
<entityInfo>

    <sqlStatements>
        <changeStatement id="create" parameterMap="insertParamMap">
            <command>
                INSERT INTO Persons ( FirstName, LastName, Age ) VALUES ( @firstname, @lastname, @age )
            </command>
        </changeStatement>
        <selectStatement id="all" resultMap="personResultMap">
            <command>
                SELECT PersonId, FirstName, LastName, Age FROM Persons 
            </command>
        </selectStatement>
        <storeProcedure id="createPerson" name="sp_CreatePerson" parameterMap="insertParamMap" />
    </sqlStatements>
   
    <maps>
        <resultMap id="personResultMap">
            <fields>
                <field property="Id" column="PersonId" />
                <field property="FirstName" column="FirstName" />
                <field property="LastName" column="LastName" />
                <field property="Age" column="Age" />
            </fields>
        </resultMap>
        <parameterMap id="insertParamMap">
            <params>
                <param name="firstname" property="FirstName" />
                <param name="lastname" property="LastName" />
                <param name="age" property="Age" />
            </params>
        </parameterMap>
     </maps>
</entityInfo>



// create mapper
EntityMapper mapper = new EntityMapper( <connString> );

// example of query
IList<Person> result = (Ilist<Person>)mapper.ExecuteStatement<Person>( "all", null );

Last edited Jul 22, 2009 at 10:53 AM by antdimot, version 13