![]() |
VOOZH | about |
This article illustrates using LINQ to access tables within the Xero via the CData ADO.NET Data Provider for Xero. 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.
Accessing and integrating live data from Xero has never been easier with CData. Customers rely on CData connectivity to:
Customers regularly integrate their Xero data with preferred tools, like Tableau, Qlik Sense, or Excel, and integrate Xero data into their database or data warehouse.
See the help documentation for a guide to setting up an EF 6 project to use the provider.
Enter your data source connection information.
To connect, set the Schema connection property in addition to any authentication values. Xero offers authentication for private applications, public applications, and partner applications. Set the XeroAppAuthentication property to PUBLIC, PRIVATE, or PARTNER, depending on the type of application configured. To connect from a private application, you will additionally need to set the OAuthAccessToken, OAuthClientId, OAuthClientSecret, CertificateStoreType, CertificateStore, and CertificateStorePassword.
To connect from a public or partner application, you can use the embedded OAuthClientId, OAuthClientSecret, and CallbackURL, or you can register an app to obtain your own OAuth values.
See the "Getting Started" chapter of the help documentation for a guide to authenticating to Xero.
Below is a typical connection string:
InitiateOAuth=GETANDREFRESH;
Using the entity you created, you can now perform select , update, delete, and insert commands. For example:
XeroEntities context = new XeroEntities();
var itemsQuery = from items in context.Items
select items;
foreach (var result in itemsQuery) {
Console.WriteLine("{0} {1} ", result.Id, result.Name);
}
See "LINQ and Entity Framework" chapter in the help documentation for example queries of the supported LINQ.
Download a free trial of the Xero Data Provider to get started:
Download NowLearn more:
👁 Xero IconComplete read-write access to Xero accounting enables developers to search (Customers, Transactions, Invoices, Sales Receipts, etc.), update items, edit customers, and more, from any .NET application.