Data Access has been discontinued. Please refer to this page for more information.

Integrating Telerik® Data Access using NuGet packages

This article is relevant to entity models that utilize the deprecated Visual Studio integration of Telerik Data Access. The current documentation of the Data Access framework is available here.

Telerik Data Access has two NuGet packages which allow you to integrate it into your solution - Telerik.DataAccess.Fluent and Telerik.DataAccess.Core. They will enable you to develop and deploy applications which are using Telerik Data Access on machines which do not have it installed. In this article you will learn the purpose of those packages and how to use them.

Telerik.DataAccess.Fluent package

The Telerik.DataAccess.Fluent package is designed to be used in the data access layer of your application - where your Telerik Data Access model will reside. The package includes a .targets file, the Telerik Data Access Enhancer tool together with its dependencies. The Enhancer is automatically called as a post-build step to provide the persistent capability, change tracking and lazy loading functionality to your model. The Fluent package is dependent on the Telerik.DataAccess.Core package.

Installing Telerik.DataAccess.Fluent

  1. Right-click on the project which will hold your Telerik Data Access model.
  2. Select the Manage NuGet Packages... option.
  3. In the NuGet packages manager, select the Online node and search for Telerik.DataAccess.Fluent.

  4. Select the Telerik.DataAccess.Fluent package and click the install button. This will install both Telerik.DataAccess.Fluent package and its dependency Telerik.DataAccess.Core.

As a result of the installation, the following items will be added to the project:

  • The OpenAccessNuGet.targets file.
  • A reference to Telerik.OpenAccess assembly.
  • A reference to Telerik.OpenAccess.Runtime assembly.
  • A reference to Telerik.OpenAccess.35.Extensions assembly.

In addition, the Enhancer together with its dependencies will be deployed in the Telerik.DataAccess.Fluent folder found in the packages directory of your solution.

After installing the Fluent package, you are ready to start defining your Fluent Model. For more information about doing so you may refer to this section or check out our Telerik.DataAccess.Fluent.Sample NuGet which illustrates the structure of a basic Fluent Model in C#.

An alternative workflow to install the Telerik.DataAccess.Fluent package is:

  1. Open Package Manager Console from the Tools \ Library Package Manager menu in Visual Studio.
  2. Run the command provided in NuGet Gallery.

Telerik.DataAccess.Core package

The Telerik.DataAccess.Core package is designed to be used within projects which are consuming an already existing Telerik Data Access model and do not define persistent classes themselves. The package provides the Telerik Data Accessruntime assemblies required to work with persistent classes and XML files for InteliSense support.

Installing Telerik.DataAccess.Core

  1. Right-click on the project which will be consuming your Telerik Data Access model.
  2. Select the Manage NuGet Packages... option.
  3. In the NuGet packages manager, select the Online node and search for Telerik.DataAccess.Core.

  4. Select the Telerik.DataAccess.Core package and click the install button.

As a result of the installation, to the project will be added references to the following assemblies:

  • Telerik.OpenAccess
  • Telerik.OpenAccess.Runtime
  • Telerik.OpenAccess.35.Extensions

Those assemblies, together with the XML files required for the InteliSense support are located in the Telerik.DataAccess.Core folder found in the packages directory of your solution.

After installing the Core package you are ready to consume Telerik Data Access models from within your application as you usually would:

  1. Add a reference to the model`s project and the respective using/Imports statement.
  2. Use an instance of the model`s context to perform CRUD operations as required by your scenario.
using (var context = new YourContextClassName())
{
    //........
}
Using context As New YourContextClassName()
    '........
End Using

An alternative workflow to install the Telerik.DataAccess.Core package is:

  1. Open Package Manager Console from the Tools \ Library Package Manager menu in Visual Studio.
  2. Run the command provided in NuGet Gallery.