[[["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-07 UTC."],[[["\u003cp\u003eThis page provides documentation for the \u003ccode\u003eServiceCollectionExtensions\u003c/code\u003e class within the Notebooks v2 API, a static class designed to offer extension methods for configuring API clients.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eServiceCollectionExtensions\u003c/code\u003e class includes methods like \u003ccode\u003eAddNotebookServiceClient\u003c/code\u003e, which adds a singleton \u003ccode\u003eNotebookServiceClient\u003c/code\u003e to an \u003ccode\u003eIServiceCollection\u003c/code\u003e, allowing customization via optional actions on a \u003ccode\u003eNotebookServiceClientBuilder\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eThere are two overloaded versions of the \u003ccode\u003eAddNotebookServiceClient\u003c/code\u003e method, each taking a different \u003ccode\u003eAction\u003c/code\u003e delegate, one which takes just the \u003ccode\u003eNotebookServiceClientBuilder\u003c/code\u003e, and one that takes an \u003ccode\u003eIServiceProvider\u003c/code\u003e and \u003ccode\u003eNotebookServiceClientBuilder\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eThe latest version of the API is version 1.2.0, and it is in the namespace \u003ccode\u003eMicrosoft.Extensions.DependencyInjection\u003c/code\u003e, belonging to the \u003ccode\u003eGoogle.Cloud.Notebooks.V2.dll\u003c/code\u003e assembly.\u003c/p\u003e\n"]]],[],null,["# Notebooks v2 API - Class ServiceCollectionExtensions (1.2.0)\n\nVersion latestkeyboard_arrow_down\n\n- [1.2.0 (latest)](/dotnet/docs/reference/Google.Cloud.Notebooks.V2/latest/Microsoft.Extensions.DependencyInjection.ServiceCollectionExtensions)\n- [1.1.0](/dotnet/docs/reference/Google.Cloud.Notebooks.V2/1.1.0/Microsoft.Extensions.DependencyInjection.ServiceCollectionExtensions)\n- [1.0.0](/dotnet/docs/reference/Google.Cloud.Notebooks.V2/1.0.0/Microsoft.Extensions.DependencyInjection.ServiceCollectionExtensions) \n\n public static class ServiceCollectionExtensions\n\nReference documentation and code samples for the Notebooks v2 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.Notebooks.V2/latest/Microsoft.Extensions.DependencyInjection)\n\nAssembly\n--------\n\nGoogle.Cloud.Notebooks.V2.dll\n\nMethods\n-------\n\n### AddNotebookServiceClient(IServiceCollection, Action\\\u003cNotebookServiceClientBuilder\\\u003e)\n\n public static IServiceCollection AddNotebookServiceClient(this IServiceCollection services, Action\u003cNotebookServiceClientBuilder\u003e action = null)\n\nAdds a singleton [NotebookServiceClient](/dotnet/docs/reference/Google.Cloud.Notebooks.V2/latest/Google.Cloud.Notebooks.V2.NotebookServiceClient) to `services`.\n\n### AddNotebookServiceClient(IServiceCollection, Action\\\u003cIServiceProvider, NotebookServiceClientBuilder\\\u003e)\n\n public static IServiceCollection AddNotebookServiceClient(this IServiceCollection services, Action\u003cIServiceProvider, NotebookServiceClientBuilder\u003e action)\n\nAdds a singleton [NotebookServiceClient](/dotnet/docs/reference/Google.Cloud.Notebooks.V2/latest/Google.Cloud.Notebooks.V2.NotebookServiceClient) to `services`."]]