https://shopify.dev/api/storefront
ShopifyGraphQLNet is available on NuGet. Use the package manager console in Visual Studio to install it:
Install-Package ShopifyGraphQLNetIf you're using .NET Core, you can use the dotnet command from your favorite shell:
dotnet add package ShopifyGraphQLNetThe AddShopifyGraphQLNetClient extension method is used to register services in the DI container.
Example for console app or tests:
var host = Host
.CreateDefaultBuilder()
.UseEnvironment(Environments.Development)
.ConfigureServices((context, services) =>
{
services.AddShopifyGraphQLNetClient(context.Configuration);
})
.Build();
productService = host.Services.GetRequiredService<IProductService>();
ShopifyGraphQLNet using IOptions<ShopifyGraphQLNetClientConfig> for Store name and API Access Token.
By default, these parameters should be specified in appsettings.json file.
{
"ShopifyGraphQLNetClientConfig": {
"StoreName": "",
"StorefrontApiAccessToken": "",
"AdminApiAccessToken": "",
"ApiVersion": { "Value": "2022-04" }
}
}