A collection of samples that demonstrate how to call the Google Cloud Firestore API from C#.
This sample requires .NET Core 2.0 or later. That means using Visual Studio 2017, or the command line.
-
Follow the set-up instructions in the documentation.
-
Visit the Cloud Console and create a new project. (You can't use both Cloud Firestore and Cloud Datastore in the same project, which might affect apps using App Engine. Try using Cloud Firestore with a different project if this is the case).
-
Visit the Cloud Firestore Viewer. From the 'Select a database service' screen, choose 'Cloud Firestore in Native mode'.
-
Select a Cloud Firestore location. Click 'Create Database'. When you create a Cloud Firestore database, it enables the API for you.
-
Set up authentication by following these tutorial instructions.
-
From a Powershell command line, run the Quickstart sample:
PS C:\...\dotnet-docs-samples\firestore\api\Quickstart> dotnet run Usage: C:\> dotnet run command YOUR_PROJECT_ID Where command is one of initialize-project-id add-data-1 add-data-2 retrieve-all-documents
-
And run the AddData sample to add data to Cloud Firestore:
PS C:\...\dotnet-docs-samples\firestore\api\AddData> dotnet run Usage: C:\> dotnet run command YOUR_PROJECT_ID Where command is one of add-doc-as-map update-create-if-missing add-doc-data-types add-simple-doc-as-entity set-requires-id add-doc-data-with-auto-id add-doc-data-after-auto-id update-doc update-nested-fields update-server-timestamp update-document-array
- See CONTRIBUTING.md
- See LICENSE
- See TESTING.md