![]() |
VOOZH | about |
This article illustrates using LINQ to access tables within the Google Data Catalog via the CData ADO.NET Data Provider for Google Data Catalog. 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.
Google Data Catalog uses the OAuth authentication standard. Authorize access to Google APIs on behalf on individual users or on behalf of users in a domain.
Before connecting, specify the following to identify the organization and project you would like to connect to:
Click the project selection drop-down, and select your organization from the list. Then, click More -> Settings. The organization ID is displayed on this page.
Find this by navigating to the cloud console dashboard and selecting your project from the Select from drop-down. The project ID will be present in the Project info card.
When you connect, the OAuth endpoint opens in your default browser. Log in and grant permissions to the application to completes the OAuth process. For more information, refer to the OAuth section in the Help documentation.
Below is a typical connection string:
ProjectId=YourProjectId;InitiateOAuth=GETANDREFRESH;
Using the entity you created, you can now perform select commands. For example:
GoogleDataCatalogEntities context = new GoogleDataCatalogEntities();
var schemasQuery = from schemas in context.Schemas
select schemas;
foreach (var result in schemasQuery) {
Console.WriteLine("{0} {1} ", result.Id, result.Type);
}
See "LINQ and Entity Framework" chapter in the help documentation for example queries of the supported LINQ.
Download a free trial of the Google Data Catalog Data Provider to get started:
Download NowLearn more:
👁 Google Data Catalog IconRapidly create and deploy powerful .NET applications that integrate with Google Data Catalog.