ADO.NET Provider for Freshdesk

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 Freshdesk 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 Freshdesk data source.

Scaffold All Tables

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

Scaffold-DbContext "Domain=MyDomain;APIKey=myAPIKey;" CData.EntityFrameworkCore.FreshDesk -OutputDir Models -Context FreshDeskContext

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 "Domain=MyDomain;APIKey=myAPIKey;" CData.EntityFrameworkCore.FreshDesk -OutputDir Models -Context FreshDeskContext  -Tables Tickets 

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