PTrampert.Optionals 0.4.0

There is a newer version of this package available.
See the version list below for details.
dotnet add package PTrampert.Optionals --version 0.4.0
                    
NuGet\Install-Package PTrampert.Optionals -Version 0.4.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="PTrampert.Optionals" Version="0.4.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="PTrampert.Optionals" Version="0.4.0" />
                    
Directory.Packages.props
<PackageReference Include="PTrampert.Optionals" />
                    
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 PTrampert.Optionals --version 0.4.0
                    
#r "nuget: PTrampert.Optionals, 0.4.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 PTrampert.Optionals@0.4.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=PTrampert.Optionals&version=0.4.0
                    
Install as a Cake Addin
#tool nuget:?package=PTrampert.Optionals&version=0.4.0
                    
Install as a Cake Tool

PTrampert.Optionals

Library supporting "Optional" objects, distinct from nullable. Possibly useful for PATCH routes.

Overview

PTrampert.Optionals is a C# library designed to facilitate the handling of flat PATCH objects in .NET web applications. With this library, you can easily distinguish between properties that are omitted from a PATCH request and those explicitly set to null or a value.

This is especially useful when you want to update only specific properties of an object, leaving others unchanged. For example, if you send a PATCH request like:

{
  "name": "New Name"
}

and your object contains additional properties besides name, PTrampert.Optionals makes it easy to ensure that only name is updated, and all other properties remain untouched.

Features

  • Supports "Optional" types for PATCH operations.
  • Distinguishes between omitted properties and properties set to null.
  • Designed for use in .NET web APIs.
  • Streamlines partial updates to complex objects.

Getting Started

The library is intended for scenarios where you need precise control over which properties are updated during a PATCH request. If a property is omitted from the PATCH body, it will not be changed in the target object.

Code examples and installation instructions will be added soon.

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in 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
0.4.5 209 8/13/2025
0.4.4 194 8/12/2025
0.4.3 200 8/12/2025
0.4.2 191 8/12/2025
0.4.1 203 8/11/2025
0.4.0 194 8/11/2025
0.3.2 267 8/8/2025
0.3.1 262 8/8/2025
0.3.0 261 8/8/2025
0.2.1 268 8/7/2025
0.2.0 270 8/7/2025
0.1.0 274 8/7/2025
0.0.1 281 8/6/2025