[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-28 UTC."],[[["\u003cp\u003eThis page provides reference documentation for the \u003ccode\u003eServiceCollectionExtensions\u003c/code\u003e class within the Google Cloud Spanner Instance Administration v1 API, specifically for the .NET environment.\u003c/p\u003e\n"],["\u003cp\u003eThe latest version available is \u003ccode\u003e5.0.0-beta05\u003c/code\u003e, and the page also lists many older versions from \u003ccode\u003e5.0.0-beta04\u003c/code\u003e to \u003ccode\u003e3.5.0\u003c/code\u003e with their corresponding documentation links.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eServiceCollectionExtensions\u003c/code\u003e class offers extension methods to configure API clients, and it is a static class found in the \u003ccode\u003eMicrosoft.Extensions.DependencyInjection\u003c/code\u003e namespace.\u003c/p\u003e\n"],["\u003cp\u003eThe class includes methods like \u003ccode\u003eAddInstanceAdminClient\u003c/code\u003e, which allows adding a singleton \u003ccode\u003eInstanceAdminClient\u003c/code\u003e to a service collection, providing options for configuring the client builder.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eAddInstanceAdminClient\u003c/code\u003e method has two overloads, one taking an \u003ccode\u003eAction<InstanceAdminClientBuilder>\u003c/code\u003e and another an \u003ccode\u003eAction<IServiceProvider, InstanceAdminClientBuilder>\u003c/code\u003e as a parameter to configure the client builder.\u003c/p\u003e\n"]]],[],null,["# Google Cloud Spanner Instance Administration v1 API - Class ServiceCollectionExtensions (5.1.0)\n\nVersion latestkeyboard_arrow_down\n\n- [5.1.0 (latest)](/dotnet/docs/reference/Google.Cloud.Spanner.Admin.Instance.V1/latest/Microsoft.Extensions.DependencyInjection.ServiceCollectionExtensions)\n- [5.0.0](/dotnet/docs/reference/Google.Cloud.Spanner.Admin.Instance.V1/5.0.0/Microsoft.Extensions.DependencyInjection.ServiceCollectionExtensions)\n- [4.6.0](/dotnet/docs/reference/Google.Cloud.Spanner.Admin.Instance.V1/4.6.0/Microsoft.Extensions.DependencyInjection.ServiceCollectionExtensions)\n- [4.5.0](/dotnet/docs/reference/Google.Cloud.Spanner.Admin.Instance.V1/4.5.0/Microsoft.Extensions.DependencyInjection.ServiceCollectionExtensions)\n- [4.4.0](/dotnet/docs/reference/Google.Cloud.Spanner.Admin.Instance.V1/4.4.0/Microsoft.Extensions.DependencyInjection.ServiceCollectionExtensions)\n- [4.3.0](/dotnet/docs/reference/Google.Cloud.Spanner.Admin.Instance.V1/4.3.0/Microsoft.Extensions.DependencyInjection.ServiceCollectionExtensions)\n- [4.2.0](/dotnet/docs/reference/Google.Cloud.Spanner.Admin.Instance.V1/4.2.0/Microsoft.Extensions.DependencyInjection.ServiceCollectionExtensions)\n- [4.1.0](/dotnet/docs/reference/Google.Cloud.Spanner.Admin.Instance.V1/4.1.0/Microsoft.Extensions.DependencyInjection.ServiceCollectionExtensions)\n- [4.0.0](/dotnet/docs/reference/Google.Cloud.Spanner.Admin.Instance.V1/4.0.0/Microsoft.Extensions.DependencyInjection.ServiceCollectionExtensions)\n- [3.15.1](/dotnet/docs/reference/Google.Cloud.Spanner.Admin.Instance.V1/3.15.1/Microsoft.Extensions.DependencyInjection.ServiceCollectionExtensions)\n- [3.14.0](/dotnet/docs/reference/Google.Cloud.Spanner.Admin.Instance.V1/3.14.0/Microsoft.Extensions.DependencyInjection.ServiceCollectionExtensions)\n- [3.13.0](/dotnet/docs/reference/Google.Cloud.Spanner.Admin.Instance.V1/3.13.0/Microsoft.Extensions.DependencyInjection.ServiceCollectionExtensions)\n- [3.12.0](/dotnet/docs/reference/Google.Cloud.Spanner.Admin.Instance.V1/3.12.0/Microsoft.Extensions.DependencyInjection.ServiceCollectionExtensions)\n- [3.11.0](/dotnet/docs/reference/Google.Cloud.Spanner.Admin.Instance.V1/3.11.0/Microsoft.Extensions.DependencyInjection.ServiceCollectionExtensions)\n- [3.10.0](/dotnet/docs/reference/Google.Cloud.Spanner.Admin.Instance.V1/3.10.0/Microsoft.Extensions.DependencyInjection.ServiceCollectionExtensions)\n- [3.9.0](/dotnet/docs/reference/Google.Cloud.Spanner.Admin.Instance.V1/3.9.0/Microsoft.Extensions.DependencyInjection.ServiceCollectionExtensions)\n- [3.8.0](/dotnet/docs/reference/Google.Cloud.Spanner.Admin.Instance.V1/3.8.0/Microsoft.Extensions.DependencyInjection.ServiceCollectionExtensions)\n- [3.7.0](/dotnet/docs/reference/Google.Cloud.Spanner.Admin.Instance.V1/3.7.0/Microsoft.Extensions.DependencyInjection.ServiceCollectionExtensions)\n- [3.6.0](/dotnet/docs/reference/Google.Cloud.Spanner.Admin.Instance.V1/3.6.0/Microsoft.Extensions.DependencyInjection.ServiceCollectionExtensions)\n- [3.5.0](/dotnet/docs/reference/Google.Cloud.Spanner.Admin.Instance.V1/3.5.0/Microsoft.Extensions.DependencyInjection.ServiceCollectionExtensions) \n\n public static class ServiceCollectionExtensions\n\nReference documentation and code samples for the Google Cloud Spanner Instance Administration v1 API class ServiceCollectionExtensions.\n\nStatic class to provide extension methods to configure API clients. \n\nInheritance\n-----------\n\n[object](https://learn.microsoft.com/dotnet/api/system.object) \\\u003e ServiceCollectionExtensions \n\nInherited Members\n-----------------\n\n[object.GetHashCode()](https://learn.microsoft.com/dotnet/api/system.object.gethashcode) \n[object.GetType()](https://learn.microsoft.com/dotnet/api/system.object.gettype) \n[object.MemberwiseClone()](https://learn.microsoft.com/dotnet/api/system.object.memberwiseclone) \n[object.ToString()](https://learn.microsoft.com/dotnet/api/system.object.tostring)\n\nNamespace\n---------\n\n[Microsoft.Extensions.DependencyInjection](/dotnet/docs/reference/Google.Cloud.Spanner.Admin.Instance.V1/latest/Microsoft.Extensions.DependencyInjection)\n\nAssembly\n--------\n\nGoogle.Cloud.Spanner.Admin.Instance.V1.dll\n\nMethods\n-------\n\n### AddInstanceAdminClient(IServiceCollection, Action\\\u003cInstanceAdminClientBuilder\\\u003e)\n\n public static IServiceCollection AddInstanceAdminClient(this IServiceCollection services, Action\u003cInstanceAdminClientBuilder\u003e action = null)\n\nAdds a singleton [InstanceAdminClient](/dotnet/docs/reference/Google.Cloud.Spanner.Admin.Instance.V1/latest/Google.Cloud.Spanner.Admin.Instance.V1.InstanceAdminClient) to `services`.\n\n### AddInstanceAdminClient(IServiceCollection, Action\\\u003cIServiceProvider, InstanceAdminClientBuilder\\\u003e)\n\n public static IServiceCollection AddInstanceAdminClient(this IServiceCollection services, Action\u003cIServiceProvider, InstanceAdminClientBuilder\u003e action)\n\nAdds a singleton [InstanceAdminClient](/dotnet/docs/reference/Google.Cloud.Spanner.Admin.Instance.V1/latest/Google.Cloud.Spanner.Admin.Instance.V1.InstanceAdminClient) to `services`."]]