Como autenticación para el proveedor de Entity Framework Core de Spanner, la ubicación del archivo de credenciales JSON de la cuenta de servicio se debe proporcionar en la variable de entorno GOOGLE_APPLICATION_CREDENTIALS. De lo contrario, el proveedor también puede usar las credenciales predeterminadas establecidas en la aplicación gcloud de Google Cloud CLI.
Usa el proveedor de Spanner Entity Framework Core
Para obtener más información sobre las funciones disponibles, las limitaciones del proveedor, las recomendaciones sobre cómo usarlo y los ejemplos de código, consulta la documentación de referencia en GitHub.
¿Qué sigue?
Consulta los ejemplos de código sobre cómo usar el proveedor de Spanner Entity Framework Core.
Consulta el repositorio del proveedor de Spanner Entity Framework Core en GitHub.
Presenta un problema de GitHub para informar un error o hacer una pregunta sobre el proveedor de Spanner Entity Framework.
[[["Fácil de comprender","easyToUnderstand","thumb-up"],["Resolvió mi problema","solvedMyProblem","thumb-up"],["Otro","otherUp","thumb-up"]],[["Difícil de entender","hardToUnderstand","thumb-down"],["Información o código de muestra incorrectos","incorrectInformationOrSampleCode","thumb-down"],["Faltan la información o los ejemplos que necesito","missingTheInformationSamplesINeed","thumb-down"],["Problema de traducción","translationIssue","thumb-down"],["Otro","otherDown","thumb-down"]],["Última actualización: 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)."]]