![]() |
VOOZH | about |
This article illustrates using LINQ to access tables within the Salesforce Data Cloud via the CData ADO.NET Data Provider for Salesforce Data Cloud. To achieve this, we will use LINQ to Entity Framework, which facilitates the generation of connections and can be seamlessly employed with any CData ADO.NET Data Providers to access data through LINQ.
See the help documentation for a guide to setting up an EF 6 project to use the provider.
Enter your data source connection information.
Salesforce Data Cloud supports authentication via the OAuth standard.
Set to OAuth.
CData provides an embedded OAuth application that simplifies authentication at the desktop.
You can also authenticate from the desktop via a custom OAuth application, which you configure and register at the Salesforce Data Cloud console. For further information, see Creating a Custom OAuth App in the Help documentation.
Before you connect, set these properties:
When you connect, the driver opens Salesforce Data Cloud's OAuth endpoint in your default browser. Log in and grant permissions to the application.
The driver then completes the OAuth process as follows:
For other OAuth methods, including Web Applications and Headless Machines, refer to the Help documentation.
Below is a typical connection string:
InitiateOAuth=GETANDREFRESH;
Using the entity you created, you can now perform select commands. For example:
SalesforceDataCloudEntities context = new SalesforceDataCloudEntities();
var accountQuery = from account in context.Account
select account;
foreach (var result in accountQuery) {
Console.WriteLine("{0} {1} ", result.Id, result.[Account ID]);
}
See "LINQ and Entity Framework" chapter in the help documentation for example queries of the supported LINQ.
Download a free trial of the Salesforce Data Cloud Data Provider to get started:
Download NowLearn more:
👁 Salesforce Data Cloud IconRapidly create and deploy powerful .NET applications that integrate with Salesforce Data Cloud.