ShopifySharp.Extensions.DependencyInjection 1.9.0

dotnet add package ShopifySharp.Extensions.DependencyInjection --version 1.9.0
                    
NuGet\Install-Package ShopifySharp.Extensions.DependencyInjection -Version 1.9.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="ShopifySharp.Extensions.DependencyInjection" Version="1.9.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="ShopifySharp.Extensions.DependencyInjection" Version="1.9.0" />
                    
Directory.Packages.props
<PackageReference Include="ShopifySharp.Extensions.DependencyInjection" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add ShopifySharp.Extensions.DependencyInjection --version 1.9.0
                    
#r "nuget: ShopifySharp.Extensions.DependencyInjection, 1.9.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package ShopifySharp.Extensions.DependencyInjection@1.9.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=ShopifySharp.Extensions.DependencyInjection&version=1.9.0
                    
Install as a Cake Addin
#tool nuget:?package=ShopifySharp.Extensions.DependencyInjection&version=1.9.0
                    
Install as a Cake Tool

ShopifySharp.Extensions.DependencyInjection

This package adds support for injecting ShopifySharp services into .NET classes using Microsoft's Dependency Injection framework. To do this, it exposes several methods that extend the IServiceCollection interface. Microsoft's DI framework will then make the ShopifySharp services available to the rest of your code when you add the interfaces to your class constructors.

// In your Program.cs or Startup.cs file, or wherever you register your Dependency Injection services
public class DependencyInjectionExample(IServiceCollection services)
{
    // ...
    
    // Add ShopifySharp's service factories and the LeakyBucketExecutionPolicy to your DI container
    services.AddShopifySharp<LeakyBucketExecutionPolicy>(options =>
    {
        options.RequestExecutionPolicy = new LeakyBucketExecutionPolicy(); 
    });
}

// In the class where you want to use a ShopifySharp service
public class MyClass(IOrderServiceFactory orderServiceFactory)
{
    public async Task ListOrdersForUser()
    {
        var user = await DoSomethingToGetUser();
        var credentials = new ShopifyRestApiCredentials(user.ShopDomain, user.AccessToken);
        var orderService = orderServiceFactory.Create(credentials);
        
        // Because the service was created using the injected factory class, 
        // it's automatically using the LeakyBucket request policy. That means it will
        // gracefully handle Shopify's API request limit and will wait if it hits the
        // limit (instead of throwing an exception).
        var orders = await ordrService.ListAsync();
    }
}

<a href="add-service-factories"></a>services.AddShopifySharpServiceFactories()

This extension method adds all of ShopifySharp's service factory classes to your IServiceCollection. All factories will be added as singletons to the container. No request execution policy will be added via this method, but the factories will pick up any other request execution policy you add to your DI container. See services.AddShopifySharpRequestExecutionPolicy(IRequestExecutionPolicy) to add one explicitly.

services.AddShopifySharpServiceFactories();

<a name="add-request-execution-policy"></a>services.AddShopifySharpRequestExecutionPolicy<T>()

where T: IRequestExecutionPolicy

This extension method adds the given IRequestExecutionPolicy implementation class to your DI container as a singleton. Any ShopifySharp service factories that you add to your DI container, whether manually or via the other DI methods in this package, will use this policy.

services.AddShopifySharpRequestExecutionPolicy<LeakyBucketExecutionPolicy>();

<a href="add-shopifysharp"></a>services.AddShopifySharp<T>()

where T: IRequestExecutionPolicy

This is a convenience method and simply calls the other ShopifySharp DI extension methods sequentially to inject all ShopifySharp services into your DI container.

services.AddShopifySharp<LeakyBucketExecutionPolicy>();
Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 is compatible. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on ShopifySharp.Extensions.DependencyInjection:

Package Downloads
Kentico.Xperience.Shopify

Xperience by Kentico - Shopify integration

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.9.0 8,818 8/31/2025
1.9.0-b262 144 9/26/2025
1.9.0-b261 158 9/12/2025
1.9.0-b260 159 9/10/2025
1.9.0-b259 180 9/4/2025
1.9.0-b258 178 9/4/2025
1.8.0 35,781 1/21/2025
1.8.0-b257 182 8/30/2025
1.8.0-b256 234 8/26/2025
1.8.0-b254 167 8/20/2025
1.8.0-b253 164 8/20/2025
1.8.0-b252 168 8/19/2025
1.8.0-b248 114 5/24/2025
1.8.0-b247 268 5/13/2025
1.8.0-b245 152 4/25/2025
1.8.0-b244 200 4/9/2025
1.8.0-b240 156 3/1/2025
1.8.0-b237 136 1/25/2025
1.7.0 56,702 10/1/2024
1.7.0-b236 124 1/21/2025
1.7.0-b233 160 1/20/2025
1.7.0-b232 134 1/18/2025
1.7.0-b230 119 1/16/2025
1.7.0-b229 129 1/15/2025
1.7.0-b228 149 1/4/2025
1.7.0-b227 149 1/3/2025
1.7.0-b223 149 12/10/2024
1.7.0-b221 130 12/10/2024
1.7.0-b220 131 12/6/2024
1.7.0-b219 130 12/4/2024
1.7.0-b218 127 11/29/2024
1.7.0-b216 120 11/27/2024
1.7.0-b215 145 11/15/2024
1.7.0-b214 2,024 10/21/2024
1.7.0-b213 129 10/4/2024
1.6.0 37,733 5/14/2024
1.6.0-b212 140 10/1/2024
1.6.0-b209 147 7/18/2024
1.6.0-b208 140 7/18/2024
1.6.0-b207 133 7/9/2024
1.6.0-b206 154 7/3/2024
1.6.0-b204 162 7/3/2024
1.6.0-b197 148 5/16/2024
1.5.0 60,232 4/2/2024
1.5.0-b195 179 5/14/2024
1.5.0-b193 135 5/14/2024
1.5.0-b192 154 5/10/2024
1.5.0-b191 161 5/8/2024
1.5.0-b190 156 4/30/2024
1.5.0-b189 154 4/17/2024
1.5.0-b188 154 4/11/2024
1.4.0 16,774 2/5/2024
1.4.0-b187 170 4/2/2024
1.4.0-b186 125 3/30/2024
1.4.0-b184 135 3/20/2024
1.4.0-b182 151 3/7/2024
1.4.0-b181 151 2/25/2024
1.4.0-b179 151 2/19/2024
1.4.0-b178 174 2/19/2024
1.4.0-b177 152 2/19/2024
1.4.0-b176 149 2/19/2024
1.4.0-b174 164 2/12/2024
1.4.0-b173 156 2/12/2024
1.3.0 1,779 1/5/2024
1.3.0-b172 140 2/5/2024
1.3.0-b171 150 2/5/2024
1.3.0-b170 143 1/30/2024
1.3.0-b169 139 1/29/2024
1.3.0-b168 143 1/29/2024
1.3.0-b166 152 1/19/2024
1.3.0-b165 140 1/18/2024
1.2.0 5,729 12/19/2023
1.2.0-b160 143 1/5/2024
1.1.1 249 12/18/2023
1.1.1-b158 161 12/19/2023
1.1.1-b156 192 12/19/2023
1.1.0 211 12/17/2023
1.1.0-b155 173 12/18/2023
1.1.0-b154 192 12/18/2023
1.1.0-b153 181 12/18/2023
1.0.0 1,167 12/11/2023
1.0.0-b151 201 12/17/2023
1.0.0-b150 180 12/17/2023
1.0.0-b149 155 12/16/2023
1.0.0-b146 179 12/14/2023
1.0.0-b145 197 12/14/2023
1.0.0-b144 173 12/13/2023
1.0.0-b143 178 12/11/2023
1.0.0-b142 162 12/9/2023
1.0.0-b141 162 12/9/2023
1.0.0-b139 185 12/9/2023
1.0.0-b138 178 12/8/2023