Como autenticação para o provedor do Spanner Entity Framework Core, o local do arquivo credenciais da conta de serviço
JSON precisa ser fornecido na variável de ambiente GOOGLE_APPLICATION_CREDENTIALS. Caso contrário, o provedor
também poderá usar as credenciais padrão definidas no aplicativo gcloud
da CLI do Google Cloud.
Usar o provedor do Spanner Entity Framework Core
Para mais informações sobre os recursos disponíveis, as limitações do provedor,
as recomendações sobre como usar o provedor e para amostras de código, consulte
a documentação de referência no
GitHub.
A seguir
Confira os exemplos de código sobre como usar o
provedor do Spanner Entity Framework Core.
Confira o repositório do provedor do Spanner Entity Framework Core no GitHub.
Registre um problema no GitHub para relatar um bug ou fazer uma
pergunta sobre o provedor do framework de entidade do Spanner.
[[["Fácil de entender","easyToUnderstand","thumb-up"],["Meu problema foi resolvido","solvedMyProblem","thumb-up"],["Outro","otherUp","thumb-up"]],[["Difícil de entender","hardToUnderstand","thumb-down"],["Informações incorretas ou exemplo de código","incorrectInformationOrSampleCode","thumb-down"],["Não contém as informações/amostras de que eu preciso","missingTheInformationSamplesINeed","thumb-down"],["Problema na tradução","translationIssue","thumb-down"],["Outro","otherDown","thumb-down"]],["Última atualização 2025-08-17 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)."]]