Come autenticazione per il provider Spanner Entity Framework Core, la posizione del file delle credenziali JSON dell'account di servizio deve essere fornita nella variabile di ambiente GOOGLE_APPLICATION_CREDENTIALS. In caso contrario, il fornitore può anche utilizzare le credenziali predefinite impostate nell'applicazione gcloud
Google Cloud CLI.
Utilizzare il provider Spanner Entity Framework Core
Per ulteriori informazioni sulle funzionalità disponibili, sulle limitazioni del provider, su come utilizzarlo e per esempi di codice, consulta la documentazione di riferimento su GitHub.
Passaggi successivi
Consulta gli esempi di codice su come utilizzare il provider Spanner Entity Framework Core.
Visualizza il repository del provider Spanner Entity Framework Core su GitHub.
Invia una segnalazione su GitHub per segnalare un bug o porre una domanda sul provider Entity Framework di Spanner.
[[["Facile da capire","easyToUnderstand","thumb-up"],["Il problema è stato risolto","solvedMyProblem","thumb-up"],["Altra","otherUp","thumb-up"]],[["Difficile da capire","hardToUnderstand","thumb-down"],["Informazioni o codice di esempio errati","incorrectInformationOrSampleCode","thumb-down"],["Mancano le informazioni o gli esempi di cui ho bisogno","missingTheInformationSamplesINeed","thumb-down"],["Problema di traduzione","translationIssue","thumb-down"],["Altra","otherDown","thumb-down"]],["Ultimo aggiornamento 2025-09-05 UTC."],[],[],null,["# Using Entity Framework Core with Spanner\n\n| **PostgreSQL interface note:** The Spanner Entity Framework Core provider isn't supported in PostgreSQL databases.\n\n\u003cbr /\u003e\n\nThe [Spanner Entity Framework Core provider](https://github.com/googleapis/dotnet-spanner-entity-framework) lets you\ncreate a Spanner database, run queries, and update data through an\napplication using [Entity Framework Core](https://docs.microsoft.com/en-us/ef/core/). The\nprovider is compatible with\n[Microsoft.EntityFrameworkCore 8](https://www.nuget.org/packages/Microsoft.EntityFrameworkCore/8.0).\n\nSet up the Spanner Entity Framework Core provider\n-------------------------------------------------\n\nTo set up the Spanner Entity Framework Core provider in your application, add the following\ndependency. \n\n \u003cProject Sdk=\"Microsoft.NET.Sdk\"\u003e\n\n \u003cPropertyGroup\u003e\n \u003cTargetFramework\u003enet8.0\u003c/TargetFramework\u003e\n \u003cOutputType\u003eExe\u003c/OutputType\u003e\n \u003c/PropertyGroup\u003e\n\n ...\n\n \u003cItemGroup\u003e\n \u003cPackageReference Include=\"Google.Cloud.EntityFrameworkCore.Spanner\" Version=\"3.2.0\" /\u003e\n \u003c/ItemGroup\u003e\n\n ...\n\n \u003c/Project\u003e\n\nAs authentication for the Spanner Entity Framework Core provider, the [service account JSON\ncredentials](/docs/authentication/getting-started) file location should be provided in the\n`GOOGLE_APPLICATION_CREDENTIALS` environment variable. Otherwise, the provider\ncan also use the default credentials set in the Google Cloud CLI `gcloud`\napplication.\n\nUse the Spanner Entity Framework Core provider\n----------------------------------------------\n\nFor more information about the available features, limitations of the provider,\nrecommendations on how to use the provider, and for code samples, consult\nthe [reference documentation](https://github.com/googleapis/dotnet-spanner-entity-framework#readme) on\nGitHub.\n\nWhat's next\n-----------\n\n- Checkout the [code examples](https://github.com/googleapis/dotnet-spanner-entity-framework/tree/master/Google.Cloud.EntityFrameworkCore.Spanner.Samples) on how to use the Spanner Entity Framework Core provider.\n- View the repository for the Spanner Entity Framework Core provider on [GitHub](https://github.com/googleapis/dotnet-spanner-entity-framework).\n- File a [GitHub issue](https://github.com/googleapis/dotnet-spanner-entity-framework/issues) to report a bug or ask a question about the Spanner Entity Framework provider.\n- Learn more about [Entity Framework Core](https://docs.microsoft.com/en-us/ef/core/).\n- Learn more about [NuGet](https://www.nuget.org/).\n- Learn about authorization and authentication credentials in [Getting started with authentication](/docs/authentication/getting-started)."]]