ZibStack.NET.Utils 1.6.0

There is a newer version of this package available.
See the version list below for details.
dotnet add package ZibStack.NET.Utils --version 1.6.0
                    
NuGet\Install-Package ZibStack.NET.Utils -Version 1.6.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="ZibStack.NET.Utils" Version="1.6.0">
  <PrivateAssets>all</PrivateAssets>
  <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="ZibStack.NET.Utils" Version="1.6.0" />
                    
Directory.Packages.props
<PackageReference Include="ZibStack.NET.Utils">
  <PrivateAssets>all</PrivateAssets>
  <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
                    
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 ZibStack.NET.Utils --version 1.6.0
                    
#r "nuget: ZibStack.NET.Utils, 1.6.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 ZibStack.NET.Utils@1.6.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=ZibStack.NET.Utils&version=1.6.0
                    
Install as a Cake Addin
#tool nuget:?package=ZibStack.NET.Utils&version=1.6.0
                    
Install as a Cake Tool

ZibStack.NET.Utils

A C# source generator that provides TypeScript-style utility types. No reflection, no runtime overhead.

Install

dotnet add package ZibStack.NET.Utils

Requires ZibStack.NET.Dto for PatchField<T> (used in generated properties).

What's included

[PartialFrom(typeof(T))]

Like TypeScript's Partial<T> — generates a class where every property is a PatchField<T> with an ApplyTo() method:

using ZibStack.NET.Utils;

[PartialFrom(typeof(Player))]
public partial record PartialPlayer;

// Generated: PatchField properties for all public properties of Player + ApplyTo(Player)

[IntersectFrom(typeof(T))]

Like TypeScript's & operator — combine properties from multiple types:

[IntersectFrom(typeof(Player))]
[IntersectFrom(typeof(Address))]
public partial record PlayerWithAddress;

// Generated: all properties from both types + ApplyTo(Player) + ApplyTo(Address)

[PickFrom(typeof(T), ...)]

Like TypeScript's Pick<T, K> — whitelist of properties:

[PickFrom(typeof(Player), nameof(Player.Name), nameof(Player.Level))]
public partial record PlayerSummary;

[OmitFrom(typeof(T), ...)]

Like TypeScript's Omit<T, K> — exclude listed properties:

[OmitFrom(typeof(Player), nameof(Player.Id), nameof(Player.CreatedAt))]
public partial record PlayerWithoutMeta;

Requirements

  • .NET 6+ (or .NET Framework with SDK-style projects)
  • ZibStack.NET.Dto for PatchField<T> support

License

MIT

There are no supported framework assets in this package.

Learn more about Target Frameworks and .NET Standard.

This package has no dependencies.

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
1.8.1 125 4/8/2026 1.8.1 is deprecated because it is no longer maintained.
1.8.0 109 4/8/2026
1.7.0 112 4/8/2026
1.6.0 107 4/8/2026