ZibStack.NET.Utils
1.6.0
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
<PackageReference Include="ZibStack.NET.Utils" Version="1.6.0"> <PrivateAssets>all</PrivateAssets> <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets> </PackageReference>
<PackageVersion Include="ZibStack.NET.Utils" Version="1.6.0" />
<PackageReference Include="ZibStack.NET.Utils"> <PrivateAssets>all</PrivateAssets> <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets> </PackageReference>
paket add ZibStack.NET.Utils --version 1.6.0
#r "nuget: ZibStack.NET.Utils, 1.6.0"
#:package ZibStack.NET.Utils@1.6.0
#addin nuget:?package=ZibStack.NET.Utils&version=1.6.0
#tool nuget:?package=ZibStack.NET.Utils&version=1.6.0
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.DtoforPatchField<T>support
License
MIT
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.