A collection of samples that demonstrate how to call the Google Cloud Spanner API from C#.
The Quickstart requires .NET 6 or later. That means using Visual Studio 2022, or the command line. The samples target .NET Standard 2.1.
-
Follow the set-up instructions in the documentation.
-
Enable APIs for your project. Click here to visit Cloud Platform Console and enable the Google Cloud Spanner API.
-
In the Cloud Console, create a Cloud Spanner instance and then create a database on that instance.
-
Edit
QuickStart\Program.cs
, and replace YOUR-PROJECT-ID with id of the project you created in step 1. Also, update "my-instance" and "my-database" with the id's of the instance and database you created in step 3. -
From a Powershell command line, run the QuickStart sample:
PS C:\...\dotnet-docs-samples\spanner\api\QuickStart> dotnet run Hello World
- See CONTRIBUTING.md
- See LICENSE
- See TESTING.md