nozzlegear / ShopifySharp

ShopifySharp is a .NET library that helps developers easily authenticate with and manage Shopify stores.
https://nozzlegear.com/shopify-development-handbook
MIT License
742 stars 309 forks source link

Let the service factories inject the IShopifyDomainUtility into Shopify services #984

Closed nozzlegear closed 9 months ago

nozzlegear commented 9 months ago

This pull request lets the service factories inject the IShopifyDomainUtility directly into the services they create via an internal constructor. The constructor is internal for now because I'm unsure of the design at the moment and plan to iterate on it, so I don't want anyone to rely on it yet.

The PR also adds an overload for the DI package's AddShopifySharpUtilities with a configuration action for customizing the utilities added to DI:

services.AddShopifySharpUtilities(options =>
{
    options.DomainUtility = new MyDomainUtility();
    options.RequestValidationUtility = new MyRequestValidationUtility();
    options.OauthUtility = new MyOauthUtility();
});