[フレーム]
BT

InfoQ Software Architects' Newsletter

A monthly overview of things you need to know as an architect or aspiring architect.

View an example

We protect your privacy.

Facilitating the Spread of Knowledge and Innovation in Professional Software Development

Write for InfoQ

Unlock the full InfoQ experience

Unlock the full InfoQ experience by logging in! Stay updated with your favorite authors and topics, engage with content, and download exclusive resources.

Log In
or

Don't have an InfoQ account?

Register
  • Stay updated on topics and peers that matter to youReceive instant alerts on the latest insights and trends.
  • Quickly access free resources for continuous learningMinibooks, videos with transcripts, and training materials.
  • Save articles and read at anytimeBookmark articles to read whenever youre ready.

Topics

Choose your language

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

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

Sep 04, 2013 1 min read

Write for InfoQ

Feed your curiosity. Help 550k+ global
senior developers
each month stay ahead.
Get in touch

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" />

<references>
<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" />
</references>


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" />
</fileset>
</copy>

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"/>
</exec>
</target>

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
Style

This content is in the NAnt topic

Related Topics:

Related Content

The InfoQ Newsletter

A round-up of last week’s content on InfoQ sent out every Tuesday. Join a community of over 250,000 senior developers. View an example

We protect your privacy.

BT

AltStyle によって変換されたページ (->オリジナル) /