Your opinion matters! Please fill in the InfoQ Survey!

Integrate OpenAccess ORM with NAnt using Clean, Build and Enhance Targets

| by Anand Narayanaswamy  Followers on Sep 04, 2013. Estimated reading time: 1 minute |

A note to our readers: As per your request we have developed a set of features that allow you to reduce the noise, while not losing sight of anything that is important. Get email and web notifications by choosing the topics you are interested in.

In order to Integrate OpenAccess ORM, which is Telerik's free object relational mapping tool, with NAnt, you need to make use of NAnt build definition which includes several targets such as clean, build and enhance. These targets will be used to automate the build process for the given OpenAccess ORM domain model.

The clean target is optional and used to clean up the build folder.

<target name="clean">

The implementation looks like as shown below

<include name="${build.dir}/*.*" />

On the other hand, Build target first performs source code building as shown below

<target name="build" depends="clean">

It then embeds the rlinq file as a resource and defines the required references

<include name="${source.dir}/MyModel.rlinq" />

 <include name="System" />
 <include name="System.Core" />
 <include name="System.Data" />
 <include name="Lib/Telerik.OpenAccess.dll" />
 <include name="Lib/Telerik.OpenAccess.35.Extensions.dll" />

Finally, it copies the required OA assemblies as shown below

<copy todir="${build.dir}">
 <fileset basedir="${lib.dir}">
  <include name="Telerik.OpenAccess.dll" />
  <include name="Telerik.OpenAccess.35.Extensions.dll" />

The Enhance target runs the OpenAccess ORM enhancer over the built project using the rlinq file as a metadata source as shown below

<target name="enhance" depends="build">
 <exec program="${enhancer.file}">
  <arg value="-assembly:"${build.file}" -xmlMapping:${source.dir}/MyModel.rlinq"/>

As you can notice, the above code make use of XML mapping.

"There can be scenarios where the model is defined using attributes or fluent mapping. It is possible to combine all of the mapping types in one OpenAccess ORM project," says Damyan Bogoev, Senior Software Developer, OpenAccess ORM Team, Telerik.

OpenAccess ORM enables you to generate data access layer for your applications by creating the data model.

Rate this Article

Adoption Stage

Hello stranger!

You need to Register an InfoQ account or or login to post comments. But there's so much more behind being registered.

Get the most out of the InfoQ experience.

Tell us what you think

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread
Community comments

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread


Login to InfoQ to interact with what matters most to you.

Recover your password...


Follow your favorite topics and editors

Quick overview of most important highlights in the industry and on the site.


More signal, less noise

Build your own feed by choosing topics you want to read about and editors you want to hear from.


Stay up-to-date

Set up your notifications and don't miss out on content that matters to you