[[["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-09-04 UTC."],[[["\u003cp\u003eThe latest version of the \u003ccode\u003eServiceCollectionExtensions\u003c/code\u003e is 2.8.0, with a comprehensive history of versions from 1.0.0-beta01 to 2.7.0 available.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eServiceCollectionExtensions\u003c/code\u003e is a static class that offers extension methods for configuring API clients within the \u003ccode\u003eGoogle.Cloud.GkeMultiCloud.V1\u003c/code\u003e namespace, and specifically, it facilitates the setup of singleton clients.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eServiceCollectionExtensions\u003c/code\u003e class enables the addition of clients such as \u003ccode\u003eAttachedClustersClient\u003c/code\u003e, \u003ccode\u003eAwsClustersClient\u003c/code\u003e, and \u003ccode\u003eAzureClustersClient\u003c/code\u003e to an \u003ccode\u003eIServiceCollection\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eEach client addition method, such as \u003ccode\u003eAddAttachedClustersClient\u003c/code\u003e, \u003ccode\u003eAddAwsClustersClient\u003c/code\u003e, and \u003ccode\u003eAddAzureClustersClient\u003c/code\u003e, accepts an optional \u003ccode\u003eaction\u003c/code\u003e parameter to customize the client builder before services are used, as well as accepting a service provider.\u003c/p\u003e\n"],["\u003cp\u003eThe class inherits members from the base object class, including \u003ccode\u003eGetHashCode\u003c/code\u003e, \u003ccode\u003eGetType\u003c/code\u003e, \u003ccode\u003eMemberwiseClone\u003c/code\u003e, and \u003ccode\u003eToString\u003c/code\u003e.\u003c/p\u003e\n"]]],[],null,["# Anthos Multi-Cloud v1 API - Class ServiceCollectionExtensions (2.8.0)\n\nVersion latestkeyboard_arrow_down\n\n- [2.8.0 (latest)](/dotnet/docs/reference/Google.Cloud.GkeMultiCloud.V1/latest/Microsoft.Extensions.DependencyInjection.ServiceCollectionExtensions)\n- [2.7.0](/dotnet/docs/reference/Google.Cloud.GkeMultiCloud.V1/2.7.0/Microsoft.Extensions.DependencyInjection.ServiceCollectionExtensions)\n- [2.6.0](/dotnet/docs/reference/Google.Cloud.GkeMultiCloud.V1/2.6.0/Microsoft.Extensions.DependencyInjection.ServiceCollectionExtensions)\n- [2.5.0](/dotnet/docs/reference/Google.Cloud.GkeMultiCloud.V1/2.5.0/Microsoft.Extensions.DependencyInjection.ServiceCollectionExtensions)\n- [2.4.0](/dotnet/docs/reference/Google.Cloud.GkeMultiCloud.V1/2.4.0/Microsoft.Extensions.DependencyInjection.ServiceCollectionExtensions)\n- [2.3.0](/dotnet/docs/reference/Google.Cloud.GkeMultiCloud.V1/2.3.0/Microsoft.Extensions.DependencyInjection.ServiceCollectionExtensions)\n- [2.2.0](/dotnet/docs/reference/Google.Cloud.GkeMultiCloud.V1/2.2.0/Microsoft.Extensions.DependencyInjection.ServiceCollectionExtensions)\n- [2.1.0](/dotnet/docs/reference/Google.Cloud.GkeMultiCloud.V1/2.1.0/Microsoft.Extensions.DependencyInjection.ServiceCollectionExtensions)\n- [2.0.0](/dotnet/docs/reference/Google.Cloud.GkeMultiCloud.V1/2.0.0/Microsoft.Extensions.DependencyInjection.ServiceCollectionExtensions)\n- [1.0.0-beta01](/dotnet/docs/reference/Google.Cloud.GkeMultiCloud.V1/1.0.0-beta01/Microsoft.Extensions.DependencyInjection.ServiceCollectionExtensions) \n\n public static class ServiceCollectionExtensions\n\nReference documentation and code samples for the Anthos Multi-Cloud 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.GkeMultiCloud.V1/latest/Microsoft.Extensions.DependencyInjection)\n\nAssembly\n--------\n\nGoogle.Cloud.GkeMultiCloud.V1.dll\n\nMethods\n-------\n\n### AddAttachedClustersClient(IServiceCollection, Action\\\u003cAttachedClustersClientBuilder\\\u003e)\n\n public static IServiceCollection AddAttachedClustersClient(this IServiceCollection services, Action\u003cAttachedClustersClientBuilder\u003e action = null)\n\nAdds a singleton [AttachedClustersClient](/dotnet/docs/reference/Google.Cloud.GkeMultiCloud.V1/latest/Google.Cloud.GkeMultiCloud.V1.AttachedClustersClient) to `services`.\n\n### AddAttachedClustersClient(IServiceCollection, Action\\\u003cIServiceProvider, AttachedClustersClientBuilder\\\u003e)\n\n public static IServiceCollection AddAttachedClustersClient(this IServiceCollection services, Action\u003cIServiceProvider, AttachedClustersClientBuilder\u003e action)\n\nAdds a singleton [AttachedClustersClient](/dotnet/docs/reference/Google.Cloud.GkeMultiCloud.V1/latest/Google.Cloud.GkeMultiCloud.V1.AttachedClustersClient) to `services`.\n\n### AddAwsClustersClient(IServiceCollection, Action\\\u003cAwsClustersClientBuilder\\\u003e)\n\n public static IServiceCollection AddAwsClustersClient(this IServiceCollection services, Action\u003cAwsClustersClientBuilder\u003e action = null)\n\nAdds a singleton [AwsClustersClient](/dotnet/docs/reference/Google.Cloud.GkeMultiCloud.V1/latest/Google.Cloud.GkeMultiCloud.V1.AwsClustersClient) to `services`.\n\n### AddAwsClustersClient(IServiceCollection, Action\\\u003cIServiceProvider, AwsClustersClientBuilder\\\u003e)\n\n public static IServiceCollection AddAwsClustersClient(this IServiceCollection services, Action\u003cIServiceProvider, AwsClustersClientBuilder\u003e action)\n\nAdds a singleton [AwsClustersClient](/dotnet/docs/reference/Google.Cloud.GkeMultiCloud.V1/latest/Google.Cloud.GkeMultiCloud.V1.AwsClustersClient) to `services`.\n\n### AddAzureClustersClient(IServiceCollection, Action\\\u003cAzureClustersClientBuilder\\\u003e)\n\n public static IServiceCollection AddAzureClustersClient(this IServiceCollection services, Action\u003cAzureClustersClientBuilder\u003e action = null)\n\nAdds a singleton [AzureClustersClient](/dotnet/docs/reference/Google.Cloud.GkeMultiCloud.V1/latest/Google.Cloud.GkeMultiCloud.V1.AzureClustersClient) to `services`.\n\n### AddAzureClustersClient(IServiceCollection, Action\\\u003cIServiceProvider, AzureClustersClientBuilder\\\u003e)\n\n public static IServiceCollection AddAzureClustersClient(this IServiceCollection services, Action\u003cIServiceProvider, AzureClustersClientBuilder\u003e action)\n\nAdds a singleton [AzureClustersClient](/dotnet/docs/reference/Google.Cloud.GkeMultiCloud.V1/latest/Google.Cloud.GkeMultiCloud.V1.AzureClustersClient) to `services`."]]