[[["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-09 UTC."],[[["\u003cp\u003eThis document provides reference documentation for the \u003ccode\u003eServiceCollectionExtensions\u003c/code\u003e class within the Cloud Functions v2beta API.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eServiceCollectionExtensions\u003c/code\u003e is a static class used to configure API clients via extension methods.\u003c/p\u003e\n"],["\u003cp\u003eThe class provides two \u003ccode\u003eAddFunctionServiceClient\u003c/code\u003e methods for adding a singleton \u003ccode\u003eFunctionServiceClient\u003c/code\u003e to an \u003ccode\u003eIServiceCollection\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eBoth \u003ccode\u003eAddFunctionServiceClient\u003c/code\u003e methods accept an optional action to configure the \u003ccode\u003eFunctionServiceClientBuilder\u003c/code\u003e, which is invoked before using services from the service collection.\u003c/p\u003e\n"],["\u003cp\u003eThe methods return an IServiceCollection object once they are done adding a FunctionServiceClient.\u003c/p\u003e\n"]]],[],null,["# Cloud Functions v2beta API - Class ServiceCollectionExtensions (1.0.0-beta07)\n\nVersion latestkeyboard_arrow_down\n\n- [1.0.0-beta07 (latest)](/dotnet/docs/reference/Google.Cloud.Functions.V2Beta/latest/Microsoft.Extensions.DependencyInjection.ServiceCollectionExtensions)\n- [1.0.0-beta06](/dotnet/docs/reference/Google.Cloud.Functions.V2Beta/1.0.0-beta06/Microsoft.Extensions.DependencyInjection.ServiceCollectionExtensions) \n\n public static class ServiceCollectionExtensions\n\nReference documentation and code samples for the Cloud Functions v2beta 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.Functions.V2Beta/latest/Microsoft.Extensions.DependencyInjection)\n\nAssembly\n--------\n\nGoogle.Cloud.Functions.V2Beta.dll\n\nMethods\n-------\n\n### AddFunctionServiceClient(IServiceCollection, Action\\\u003cFunctionServiceClientBuilder\\\u003e)\n\n public static IServiceCollection AddFunctionServiceClient(this IServiceCollection services, Action\u003cFunctionServiceClientBuilder\u003e action = null)\n\nAdds a singleton [FunctionServiceClient](/dotnet/docs/reference/Google.Cloud.Functions.V2Beta/latest/Google.Cloud.Functions.V2Beta.FunctionServiceClient) to `services`.\n\n### AddFunctionServiceClient(IServiceCollection, Action\\\u003cIServiceProvider, FunctionServiceClientBuilder\\\u003e)\n\n public static IServiceCollection AddFunctionServiceClient(this IServiceCollection services, Action\u003cIServiceProvider, FunctionServiceClientBuilder\u003e action)\n\nAdds a singleton [FunctionServiceClient](/dotnet/docs/reference/Google.Cloud.Functions.V2Beta/latest/Google.Cloud.Functions.V2Beta.FunctionServiceClient) to `services`."]]