Tingle.AspNetCore.JsonPatch.NewtonsoftJson 5.2.0

dotnet add package Tingle.AspNetCore.JsonPatch.NewtonsoftJson --version 5.2.0
                    
NuGet\Install-Package Tingle.AspNetCore.JsonPatch.NewtonsoftJson -Version 5.2.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="Tingle.AspNetCore.JsonPatch.NewtonsoftJson" Version="5.2.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Tingle.AspNetCore.JsonPatch.NewtonsoftJson" Version="5.2.0" />
                    
Directory.Packages.props
<PackageReference Include="Tingle.AspNetCore.JsonPatch.NewtonsoftJson" />
                    
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 Tingle.AspNetCore.JsonPatch.NewtonsoftJson --version 5.2.0
                    
#r "nuget: Tingle.AspNetCore.JsonPatch.NewtonsoftJson, 5.2.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 Tingle.AspNetCore.JsonPatch.NewtonsoftJson@5.2.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=Tingle.AspNetCore.JsonPatch.NewtonsoftJson&version=5.2.0
                    
Install as a Cake Addin
#tool nuget:?package=Tingle.AspNetCore.JsonPatch.NewtonsoftJson&version=5.2.0
                    
Install as a Cake Tool

Tingle.AspNetCore.JsonPatch.NewtonsoftJson

When performing patch operations, it is very likely that some updates to the model may try to modify or remove immutable types and thus there is a need to ensure that this is not the case before committing the changes to the persistence layer such as a database.

A sample usage of this functionality is shown below:

public class TestClass
{
    [Key]
    public string Id { get; set; }

    [Range(18, 65)]
    public int Age { get; set; }
}
public class TestController : ControllerBase
{
    [HttpPost("{id}")]
    public async Task<IActionResult> UpdateAsync([FromRoute, Required] string id, [FromBody] JsonPatchDocument<TestClass> model)
    {
        // Fetch the object that needs to be patched from your persistence layer e.g. database
        var test = await GetObjectFromDbAsync(id);

        // update the template
        model.ApplyToSafely(template, ModelState, new List<string> { "Id" });
        if (!ModelState.IsValid) return ValidationProblem();

        // validate the resulting model
        if (!TryValidateModel(test)) return ValidationProblem();

        // other code omitted for brevity
    }
}
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 is compatible.  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
5.2.0 205 4/21/2025
5.1.1 215 4/20/2025
5.1.0 203 4/20/2025
5.0.1 162 2/21/2025
5.0.0 158 11/19/2024
4.14.1 268 10/14/2024
4.14.0 254 9/16/2024
4.13.0 455 8/13/2024
4.12.0 167 8/7/2024
4.11.2 175 7/15/2024
4.11.1 203 6/26/2024
4.11.0 176 6/6/2024
4.10.1 157 6/5/2024
4.10.0 199 5/27/2024
4.9.0 177 5/16/2024
4.8.0 194 5/5/2024
4.7.0 239 3/25/2024
4.6.0 207 3/8/2024
4.5.0 266 11/22/2023
4.4.1 209 11/20/2023
4.4.0 165 11/15/2023
4.3.0 324 10/18/2023
4.2.2 321 9/20/2023
4.2.1 375 8/4/2023
4.2.0 378 5/31/2023
4.1.1 220 5/26/2023
4.1.0 222 5/22/2023
4.0.0 439 3/14/2023
2.5.0 645 11/21/2022
2.4.2 1,047 7/25/2022
2.4.1 2,148 3/22/2022
2.4.0 3,548 11/10/2021
2.3.1 2,268 9/20/2021
2.3.0 1,205 7/22/2021