ADO.NET Provider for Azure DevOps

Build 25.0.9434

Reverse Engineering (Scaffolding)

Reverse engineering (also called scaffolding) streamlines EF Core model creation by automatically generating context and entity classes from your Azure DevOps schema. This includes a CDataContext class that extends DbContext and exposes DbSet properties representing available tables and views.

Scaffolding

Scaffolding is performed using the Package Manager Console (PMC) in Visual Studio. The following commands demonstrate how to scaffold EF Core models from your live Azure DevOps data source.

Scaffold All Tables

Use the following command to scaffold all tables and views into a Models folder:

Scaffold-DbContext "AuthScheme=Basic;Organization=MyAzureDevOpsOrganization;Catalog=Project_dev;Schema=Project;PersonalAccessToken=MyPAT;" CData.EntityFrameworkCore.AzureDevOps -OutputDir Models -Context AzureDevOpsContext

Scaffold A Subset of Tables

You can refine the scaffolding process to only create classes for a limited selection of tables. This is useful when a large schema is taking a long time to scaffold due to the large number of classes it has to generate. This is accomplished by specifying the tables/views that you want to scaffold at the end of your Scaffold-DbContext command in the PMC.

Scaffold-DbContext "AuthScheme=Basic;Organization=MyAzureDevOpsOrganization;Catalog=Project_dev;Schema=Project;PersonalAccessToken=MyPAT;" CData.EntityFrameworkCore.AzureDevOps -OutputDir Models -Context AzureDevOpsContext  -Tables WorkItems 

Updating your Data Model

To refresh an existing model with updated tables or schema changes, add the -Force argument to your scaffolding command. This overwrites any previously generated model files.

Copyright (c) 2025 CData Software, Inc. - All rights reserved.
Build 25.0.9434