[[["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\u003eThe \u003ccode\u003eServiceCollectionExtensions\u003c/code\u003e class provides extension methods for configuring Memorystore API clients within .NET applications.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eAddMemorystoreClient\u003c/code\u003e method adds a singleton \u003ccode\u003eMemorystoreClient\u003c/code\u003e to the \u003ccode\u003eIServiceCollection\u003c/code\u003e, allowing for the client to be configured.\u003c/p\u003e\n"],["\u003cp\u003eThere are two overloads of the \u003ccode\u003eAddMemorystoreClient\u003c/code\u003e method, one taking an \u003ccode\u003eAction<MemorystoreClientBuilder>\u003c/code\u003e and the other taking an \u003ccode\u003eAction<IServiceProvider, MemorystoreClientBuilder>\u003c/code\u003e to allow for more advanced configuration.\u003c/p\u003e\n"],["\u003cp\u003eBoth \u003ccode\u003eAddMemorystoreClient\u003c/code\u003e methods return an \u003ccode\u003eIServiceCollection\u003c/code\u003e, enabling fluent configuration of the client.\u003c/p\u003e\n"]]],[],null,["# Memorystore v1 API - Class ServiceCollectionExtensions (1.0.0-beta03)\n\nVersion latestkeyboard_arrow_down\n\n- [1.0.0-beta03 (latest)](/dotnet/docs/reference/Google.Cloud.Memorystore.V1/latest/Microsoft.Extensions.DependencyInjection.ServiceCollectionExtensions)\n- [1.0.0-beta02](/dotnet/docs/reference/Google.Cloud.Memorystore.V1/1.0.0-beta02/Microsoft.Extensions.DependencyInjection.ServiceCollectionExtensions) \n\n public static class ServiceCollectionExtensions\n\nReference documentation and code samples for the Memorystore 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.Memorystore.V1/latest/Microsoft.Extensions.DependencyInjection)\n\nAssembly\n--------\n\nGoogle.Cloud.Memorystore.V1.dll\n\nMethods\n-------\n\n### AddMemorystoreClient(IServiceCollection, Action\\\u003cMemorystoreClientBuilder\\\u003e)\n\n public static IServiceCollection AddMemorystoreClient(this IServiceCollection services, Action\u003cMemorystoreClientBuilder\u003e action = null)\n\nAdds a singleton [MemorystoreClient](/dotnet/docs/reference/Google.Cloud.Memorystore.V1/latest/Google.Cloud.Memorystore.V1.MemorystoreClient) to `services`.\n\n### AddMemorystoreClient(IServiceCollection, Action\\\u003cIServiceProvider, MemorystoreClientBuilder\\\u003e)\n\n public static IServiceCollection AddMemorystoreClient(this IServiceCollection services, Action\u003cIServiceProvider, MemorystoreClientBuilder\u003e action)\n\nAdds a singleton [MemorystoreClient](/dotnet/docs/reference/Google.Cloud.Memorystore.V1/latest/Google.Cloud.Memorystore.V1.MemorystoreClient) to `services`."]]