StrawberryShake.Extensions.DynamicVariables 1.0.0

The owner has unlisted this package. This could mean that the package is deprecated, has security vulnerabilities or shouldn't be used anymore.
dotnet add package StrawberryShake.Extensions.DynamicVariables --version 1.0.0
                    
NuGet\Install-Package StrawberryShake.Extensions.DynamicVariables -Version 1.0.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="StrawberryShake.Extensions.DynamicVariables" Version="1.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="StrawberryShake.Extensions.DynamicVariables" Version="1.0.0" />
                    
Directory.Packages.props
<PackageReference Include="StrawberryShake.Extensions.DynamicVariables" />
                    
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 StrawberryShake.Extensions.DynamicVariables --version 1.0.0
                    
#r "nuget: StrawberryShake.Extensions.DynamicVariables, 1.0.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 StrawberryShake.Extensions.DynamicVariables@1.0.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=StrawberryShake.Extensions.DynamicVariables&version=1.0.0
                    
Install as a Cake Addin
#tool nuget:?package=StrawberryShake.Extensions.DynamicVariables&version=1.0.0
                    
Install as a Cake Tool

StrawberryShake.Extensions.DynamicVariables

A C# source generator that adds ExecuteDynamicAsync to StrawberryShake operations - use anonymous types while preserving property order and keeping full type safety on results.

Installation

dotnet add package StrawberryShake.Extensions.DynamicVariables

No configuration needed. The generator automatically extends all your mutations and queries.

Usage

var result = await client.CreateOrder.ExecuteDynamicAsync(new
{
    cid = companyId,
    orders = new[]
    {
        new
        {
            customerNo = 10000,
            orderLines = new[] { new { productNo = "1000", quantity = 2 } }
        }
    }
});

// Return type is fully typed: IOperationResult<ICreateOrderResult>
var orderNo = result.Data?.UseCompany?.Order_create?.Items?[0].OrderNo;

Why?

StrawberryShake generates strongly-typed input classes, but:

  • Property order isn't preserved - C# dictionaries don't maintain insertion order, breaking APIs that expect specific field ordering
  • Schema changes require regeneration - adding optional fields means regenerating all client code

This generator solves both problems by serializing your variables with System.Text.Json, which preserves property declaration order.

Features

  • Zero configuration - install and it works
  • Property order preserved - JSON fields appear in declaration order
  • Type-safe results - full IntelliSense on response types
  • Flexible inputs - anonymous types, records, classes, or JsonObject
  • No reflection - compile-time generation using partial classes

Compatibility

  • .NET 6, 8, 10+
  • StrawberryShake 15.x

License

MIT

There are no supported framework assets in this package.

Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated

v1.0.0: Initial release. Adds ExecuteDynamicAsync to all StrawberryShake operations with property order preservation.